Searched refs:state (Results 1 - 25 of 67) sorted by relevance

123

/ontohub/spec/factories/
H A Dapi_key_factory.rb4 state { 'valid' }
7 state { 'invalid' }
H A Dhets_instance_factory_factory.rb18 state { 'free' }
/ontohub/db/migrate/
H A D20150807083608_add_hets_instance_load_balancing_attributes.rb3 add_column :hets_instances, :state, :string
7 add_index :hets_instances, :state
/ontohub/lib/
H A Dproof_evaluation_state_updater.rb4 attr_reader :proof_attempt, :state, :message, :theorem
6 def initialize(proof_attempt, state, message = nil)
8 @state = state.to_sym
14 proof_attempt.update_state!(state, message)
22 most_successful(theorem.proof_attempts.select(:state).map(&:state))
33 theorem.proof_attempts.select(%i(id number)).state(:failed)
H A Dstate.rb16 def self.terminal?(state)
17 TERMINAL_STATES.include?(state)
24 def self.success_order(state)
25 STATES.index(state)
H A Dstate_updater.rb7 scope :state, ->(*states){
8 where state: states.map(&:to_s)
36 error = "Nested exception on updating state of #{self.class} #{id}\n"
42 state: 'failed',
53 def update_state!(state, error_message = nil)
54 update_attributes!({state: state.to_s,
/ontohub/spec/lib/
H A Dproof_evaluation_state_updater_spec.rb4 context 'single proof attempt from pending state' do
5 let(:proof_attempt) { create :proof_attempt, state: 'pending' }
8 %i(done failed processing).each do |state|
9 context "to #{state}" do
10 let(:pesu) { ProofEvaluationStateUpdater.new(proof_attempt, state) }
13 it "update the state to #{state}" do
14 expect(proof_attempt.state).to eq(state.to_s)
17 it "theorem is #{state}" d
[all...]
H A Dhets_instance_foce_free_worker_spec.rb10 let!(:hets_instance) { create :hets_instance, state: 'free' }
18 expect(hets_instance.reload.state).to eq('free')
23 let!(:hets_instance) { create :hets_instance, state: 'force-free' }
31 expect(hets_instance.reload.state).to eq('force-free')
36 let!(:hets_instance) { create :hets_instance, state: 'busy' }
43 it 'change the state' do
44 expect(hets_instance.reload.state).to eq('force-free')
H A Dtimeout_worker_spec.rb26 context 'when the state is processing' do
34 it 'will set the state of the ontology version to failed' do
35 expect(ontology_version.state).to eq('failed')
42 it 'will set the state of the ontology to failed' do
43 expect(ontology.state).to eq('failed')
49 let(:ontology_version) { create :ontology_version, state: 'done' }
51 it 'will not touch the state of the ontology_version' do
53 to_not change(ontology_version, :state)
56 it 'will not touch the state of the ontology' do
58 to_not change(ontology, :state)
[all...]
H A Drepository_pulling_worker_spec.rb7 shared_examples 'perform' do |state, minutes, created_jobs_count|
8 context("state #{state}, imported " +
12 {state: state.to_s,
/ontohub/app/viewhelpers/
H A Dstatus_overview_viewhelper.rb5 states_map(0).merge!(Ontology.group(:state).count)
15 Ontology::States::STATES.each do |state|
16 hash[state] = default
H A Dstatus_ontology_error_viewhelper.rb14 Ontology.where(state: STATE)
19 where(state: STATE).
/ontohub/features/step_definitions/
H A Dontology_state_steps.rb6 Given(/^there is an ontology with a "([^"]+)" version$/) do |state|
7 @ontology_version = FactoryGirl.create :ontology_version, state: state
9 @ontology.state = state
21 When(/^we change the state of the ontology to: (\w+)$/) do |state|
22 @state = state
23 @ontology_version.update_state!(state)
[all...]
H A Dprocessing_ontologies_status_steps.rb27 Given(/^i have (\d+) (#{Ontology::States::STATES.join('|')}) ontologies$/) do |count, state|
28 @ontology_versions = FactoryGirl.create_list(:ontology_version, count, state: state)
31 expect(ontology.state).to eq(state)
/ontohub/app/models/
H A Dapi_key.rb6 attr_accessible :key, :state
13 validates :state, inclusion: {in: STATES}
15 scope :valid, -> { where(state: 'valid') }
26 self.state = 'invalid'
33 set_valid! unless state
42 self.state = 'valid'
H A Dhets_instance.rb27 attr_accessible :name, :uri, :state, :queue_size
33 validate :state, inclusion: {in: STATES}
40 where(state: 'free')
43 where(state: 'force-free')
46 where(state: 'busy')
137 self.state = 'free'
142 if reload.state == 'busy'
143 self.state = 'force-free'
149 self.state = 'busy'
/ontohub/app/models/ontology/
H A Dstates.rb7 STATES.each do |state|
8 eval "def #{state}?; state == '#{state}'; end"
15 state(:failed).without_parent.find_each do |ontology|
22 select("state, count(*) AS count").group(:state)
H A Dversions.rb42 return self.ontology_version if self.state == 'done'
44 where(ontology_id: self, state: 'done').
59 state = "done"
63 "(SELECT ontology_id FROM ontology_versions WHERE state = ?)",
64 state
70 state = "done"
71 stmt = ['state != ?', state] if user == true
73 stmt = ['state != ? AND ' +
75 'WHERE user_id = ?)', state, use
[all...]
H A Dvalidations.rb12 validates :state, inclusion: {in: Ontology::States::STATES}
/ontohub/app/helpers/
H A Dstate_helper.rb4 resource.state == 'failed' &&
34 "evaluation-state label #{State::STATE_LABEL[resource.state.to_sym]}",
39 state: resource.state,
43 state(resource)
47 def state(resource) method in class:StateHelper
48 html = content_tag(:span, t("states.#{resource.state}"))
50 unless State::IDLE_STATES.include?(resource.state)
54 if resource.state
[all...]
/ontohub/app/models/ontology_version/
H A Dstates.rb26 msg = [state]
48 ontology.state = state
51 ontology.children.update_all(state: ontology.state)
H A Doops_requests.rb9 request.nil? || request.state == 'failed'
/ontohub/spec/models/
H A Dapi_key_spec.rb15 expect(described_class.where(state: 'valid').to_a).
21 expect(old_key.state).to eq('invalid')
36 it 'unacceptable state' do
37 invalid_key = build(:api_key, state: 'nice state')
H A Dhets_instance_spec.rb87 context 'try again re-checks up-state' do
137 let!(:hets_instance) { create :hets_instance, state: 'free' }
153 expect(chosen.state).to eq('free')
159 let!(:free) { create :hets_instance, state: 'free' }
160 let!(:force_free) { create :hets_instance, state: 'force-free' }
161 let!(:busy) { create :hets_instance, state: 'busy' }
179 expect(instance.state).to eq('busy')
202 expect(instance.state).to eq('free')
213 expect(instance.state).to eq('busy')
220 expect(chosen.state)
[all...]
/ontohub/app/controllers/
H A Dhome_controller.rb9 where(state: 'done').limit(10)

Completed in 82 milliseconds

123