factory_toys 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -1,30 +1,26 @@
1
1
  = FactoryToys
2
2
 
3
- This is a idea to help with Feature Management and works in a as a set of
4
- feature configuration files that can use ruby to do fancy things and ultimately
5
- simplify the process of updating your features.
3
+ This is a idea to help with Feature Management and works in a as a set of
4
+ feature configuration files that can use ruby to do fancy things and ultimately
5
+ simplify the process of updating your features.
6
6
 
7
- The tool is designed to be use where you need to manage large numbers of
8
- features which all have very similar featureset (i.e. only one of two difference)
7
+ The tool is designed to be use where you need to manage large numbers of
8
+ features which all have very similar featureset (i.e. only one of two difference)
9
9
 
10
10
  == Can't I just use Scenario Outlines to do this I hear you ask..
11
11
 
12
- You some it it you can.. but the things you can't:
12
+ You some it it you can.. but the things you can't:
13
13
 
14
14
  * Use a parameter to slightly change you hook configuration
15
- * Output actual features which is my mind makes fixing any breaks in the test
16
- easier.
15
+ * Output actual features which is my mind makes fixing any breaks in the test easier.
17
16
 
18
17
 
19
18
  == ToDo
20
19
 
21
20
  * Allow scenarios to be built from parts rather than just as a block of text
22
- => allow common parts of features to only be specified once and then shared
23
- basically
24
- * Add functionality to only rebuild the feature file if there has been a change
25
- most likely using fssm once I have a look and understand how it works..
26
- * Add other configuration options.. Not really sure what else is needed but
27
- am sure somthing will turn up
21
+ - allow common parts of features to only be specified once and then shared basically
22
+ * Add functionality to only rebuild the feature file if there has been a change most likely using fssm once I have a look and understand how it works..
23
+ * Add other configuration options.. Not really sure what else is needed but am sure somthing will turn up
28
24
  * Fix the readme so it is not quite so much of a ramble.
29
25
  * Add exmaple code to the readme so that people can see how this should work
30
26
  * Add generator so that templates can be generated
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
data/factory_toys.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{factory_toys}
8
- s.version = "0.1.1"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Henry", "Thomas Brand"]
@@ -1,6 +1,6 @@
1
1
  module FactoryToys
2
2
  class FFactory # Feature Factory
3
- attr_accessor :output, :filename
3
+ attr_accessor :filename
4
4
  attr_accessor :data
5
5
 
6
6
  def initialize(filename)
@@ -9,7 +9,14 @@ module FactoryToys
9
9
  #build_output(filename)
10
10
  end
11
11
 
12
- def output(filename)
12
+ def write
13
+ filname = @filename.gsub(/.rb/,'.feature')
14
+ File.open(FactoryToys.features_location + "/" + filename, 'w') do |f|
15
+ f.puts self.output
16
+ end
17
+ end
18
+
19
+ def output
13
20
  eval(self.data[:base])
14
21
 
15
22
  self.build_feature(self.data[:feature])
data/lib/factory_toys.rb CHANGED
@@ -20,6 +20,12 @@ module FactoryToys
20
20
  raise MissingEnvironmentError
21
21
  end
22
22
 
23
+ def features_location
24
+ @features_location = ::RAILS_ROOT + '/' + self.features_directory
25
+ rescue NameError
26
+ raise MissingEnvironmentError
27
+ end
28
+
23
29
  protected
24
30
  def source_files
25
31
  Dir.glob(self.source_location, '*')
@@ -30,7 +36,8 @@ module FactoryToys
30
36
  public
31
37
  def update_features
32
38
  self.source_files.each do |file|
33
- FactoryToys::FFactory.new(file)
39
+ ft = FactoryToys::FFactory.new(file)
40
+ ft.write
34
41
  end
35
42
  end
36
43
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_toys
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Henry