answer-factory 0.0.7 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/Thorfile CHANGED
@@ -1,47 +1,6 @@
1
1
  require 'active_support'
2
2
  require 'answer-factory'
3
3
 
4
- class Setup_Factory < Thor::Group
5
- include Thor::Actions
6
-
7
- # Define arguments and options
8
- argument :project_name
9
- class_options :test_framework => :rspec
10
-
11
- desc "Creates a new project folder structure for new Nudge types, instructions, search operators and specs"
12
-
13
- def self.source_root
14
- File.dirname(__FILE__)
15
- end
16
-
17
- def answer_factory_gem_path
18
- AnswerFactory.gem_root
19
- end
20
-
21
- def set_up_project_in_this_folder
22
- empty_directory("./lib")
23
- empty_directory("./lib/nudge/instructions")
24
- empty_directory("./lib/nudge/types")
25
- empty_directory("./lib/factory/operators")
26
- empty_directory("./spec")
27
- end
28
-
29
- def create_runner
30
- template("#{answer_factory_gem_path}/templates/answer_factory_activate_template.erb", "./activate.rb")
31
- end
32
-
33
- def create_spec_helper
34
- filename = "spec_helper.rb"
35
- template("#{answer_factory_gem_path}/templates/answer_factory_spec_helper_template.erb",
36
- "#{New_Nudge_Type.source_root}/spec/#{filename}")
37
- end
38
-
39
- def say_byebye
40
- puts "your answer-factory project is located in directory #{Dir.pwd}\n"
41
- end
42
- end
43
-
44
-
45
4
  class New_Nudge_Type < Thor::Group
46
5
  include Thor::Actions
47
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.9
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{answer-factory}
8
- s.version = "0.0.7"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bill Tozier", "Trek Glowacki", "Jesse Sielaff"]
12
- s.date = %q{2010-04-30}
12
+ s.date = %q{2010-05-02}
13
13
  s.default_executable = %q{answer-factory}
14
14
  s.description = %q{The pragmaticgp gem provides a simple framework for building, running and managing genetic programming experiments which automatically discover algorithms and equations to solve user-defined problems.}
15
15
  s.email = %q{bill@vagueinnovation.com}
@@ -42,6 +42,7 @@ Gem::Specification.new do |s|
42
42
  "spec/config_spec.rb",
43
43
  "spec/factories/factory_spec.rb",
44
44
  "spec/factories/workstation_spec.rb",
45
+ "spec/integration_specs/thor_integration.rb",
45
46
  "spec/operators/any_one_sampler_spec.rb",
46
47
  "spec/operators/dominated_quantile_spec.rb",
47
48
  "spec/operators/duplicate_genomes_spec.rb",
@@ -58,6 +59,7 @@ Gem::Specification.new do |s|
58
59
  "spec/operators/resample_values_spec.rb",
59
60
  "spec/operators/uniformBackboneCrossover_spec.rb",
60
61
  "spec/spec_helper.rb",
62
+ "tasks/setup_factory.thor",
61
63
  "templates/answer_factory_activate_template.erb",
62
64
  "templates/answer_factory_spec_helper_template.erb"
63
65
  ]
@@ -73,6 +75,7 @@ Gem::Specification.new do |s|
73
75
  "spec/config_spec.rb",
74
76
  "spec/factories/factory_spec.rb",
75
77
  "spec/factories/workstation_spec.rb",
78
+ "spec/integration_specs/thor_integration.rb",
76
79
  "spec/operators/any_one_sampler_spec.rb",
77
80
  "spec/operators/dominated_quantile_spec.rb",
78
81
  "spec/operators/duplicate_genomes_spec.rb",
@@ -11,6 +11,9 @@ if Dir.exist?(project_root) then
11
11
  else
12
12
  Dir.mkdir(project_root)
13
13
  cp("#{gem_root}/Thorfile","#{project_root}/Thorfile")
14
+ mkdir("#{project_root}/tasks")
15
+ cp("#{gem_root}/tasks/setup_factory.thor","#{project_root}/tasks/setup_factory.thor")
14
16
  cd("#{project_root}")
15
17
  puts `thor setup_factory:set_up_project_in_this_folder #{project_root}`
18
+ rm("./tasks/setup_factory.thor")
16
19
  end
@@ -3,6 +3,8 @@ $: << File.join(File.dirname(__FILE__), "/../lib")
3
3
  require 'rubygems'
4
4
  require 'nudge'
5
5
 
6
+ require 'couchrest'
7
+
6
8
  require 'answers/answer'
7
9
  require 'answers/batch'
8
10
 
@@ -1,7 +1,6 @@
1
1
  #encoding: utf-8
2
2
  require File.join(File.dirname(__FILE__), "spec_helper")
3
3
 
4
-
5
4
  describe "Answer" do
6
5
 
7
6
  describe "initialization" do
@@ -0,0 +1,33 @@
1
+ require File.join(File.dirname(__FILE__), "./../spec_helper")
2
+
3
+ require 'fileutils'
4
+ include FileUtils::Verbose
5
+
6
+ describe "Setup_Factory" do
7
+ before(:each) do
8
+ @startpoint = Dir.pwd
9
+ @project_name = "spec_thor_makeshift_projectname"
10
+ rmtree("./spec/scratch/#{@project_name}") if Dir.exists?("./spec/scratch/#{@project_name}")
11
+ Dir.mkdir("./spec/scratch/#{@project_name}")
12
+ Dir.chdir("./spec/scratch/#{@project_name}")
13
+ end
14
+
15
+ after(:each) do
16
+ Dir.chdir(@startpoint)
17
+ rmtree("./spec/scratch/#{@project_name}") if Dir.exists?("./spec/scratch/#{@project_name}")
18
+ end
19
+
20
+ it "should create a subdirectory /lib in the current directory"
21
+
22
+ # it "should create a subdirectory /lib/factory/operators in the current directory"
23
+ #
24
+ # it "should create a subdirectory /lib/nudge/types in the current directory"
25
+ #
26
+ # it "should create a subdirectory /lib/nudge/instructions in the current directory"
27
+ #
28
+ # it "should create a subdirectory /spec in the current directory"
29
+ #
30
+ # it "should create (copy) activate.rb"
31
+ #
32
+ # it "should create (copy) /spec/spec_helper.rb"
33
+ end
@@ -1,14 +1,9 @@
1
1
  #encoding: utf-8
2
2
  $: << File.join(File.dirname(__FILE__), "/../lib")
3
3
 
4
-
5
4
  require 'spec'
6
- require 'pp'
7
- require 'answer-factory'
8
- require 'erb'
9
5
  require 'fakeweb'
10
- require 'couchrest'
11
- require 'json'
6
+ require './lib/answer-factory'
12
7
 
13
- include Nudge
14
- include AnswerFactory
8
+ include AnswerFactory
9
+ include Nudge
@@ -0,0 +1,41 @@
1
+ require 'active_support'
2
+ require 'answer-factory'
3
+
4
+ class Setup_Factory < Thor::Group
5
+ include Thor::Actions
6
+
7
+ # Define arguments and options
8
+ argument :project_name
9
+ class_options :test_framework => :rspec
10
+
11
+ desc "Creates a new project folder structure for new Nudge types, instructions, search operators and specs"
12
+
13
+ def self.source_root
14
+ File.dirname(__FILE__)
15
+ end
16
+
17
+ def answer_factory_gem_path
18
+ AnswerFactory.gem_root
19
+ end
20
+
21
+ def set_up_project_in_this_folder
22
+ empty_directory("./lib")
23
+ empty_directory("./lib/nudge/instructions")
24
+ empty_directory("./lib/nudge/types")
25
+ empty_directory("./lib/factory/operators")
26
+ empty_directory("./spec")
27
+ end
28
+
29
+ def create_runner
30
+ template("#{answer_factory_gem_path}/templates/answer_factory_activate_template.erb", "./activate.rb") unless File.exists?("./activate.rb")
31
+ end
32
+
33
+ def create_spec_helper
34
+ template("#{answer_factory_gem_path}/templates/answer_factory_spec_helper_template.erb",
35
+ "#{New_Nudge_Type.source_root}/spec/spec_helper.rb") unless File.exists?("#{New_Nudge_Type.source_root}/spec/spec_helper.rb")
36
+ end
37
+
38
+ def say_byebye
39
+ puts "your answer-factory project is located in directory #{Dir.pwd}\n"
40
+ end
41
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 7
9
- version: 0.0.7
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bill Tozier
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-30 00:00:00 -04:00
19
+ date: 2010-05-02 00:00:00 -04:00
20
20
  default_executable: answer-factory
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -132,6 +132,7 @@ files:
132
132
  - spec/config_spec.rb
133
133
  - spec/factories/factory_spec.rb
134
134
  - spec/factories/workstation_spec.rb
135
+ - spec/integration_specs/thor_integration.rb
135
136
  - spec/operators/any_one_sampler_spec.rb
136
137
  - spec/operators/dominated_quantile_spec.rb
137
138
  - spec/operators/duplicate_genomes_spec.rb
@@ -148,6 +149,7 @@ files:
148
149
  - spec/operators/resample_values_spec.rb
149
150
  - spec/operators/uniformBackboneCrossover_spec.rb
150
151
  - spec/spec_helper.rb
152
+ - tasks/setup_factory.thor
151
153
  - templates/answer_factory_activate_template.erb
152
154
  - templates/answer_factory_spec_helper_template.erb
153
155
  has_rdoc: true
@@ -188,6 +190,7 @@ test_files:
188
190
  - spec/config_spec.rb
189
191
  - spec/factories/factory_spec.rb
190
192
  - spec/factories/workstation_spec.rb
193
+ - spec/integration_specs/thor_integration.rb
191
194
  - spec/operators/any_one_sampler_spec.rb
192
195
  - spec/operators/dominated_quantile_spec.rb
193
196
  - spec/operators/duplicate_genomes_spec.rb