cukedep 0.1.05 → 0.1.06

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmZmMTZlZmJkZDljYTBiYTNlM2Q4ZGNjYjIxNjU5MTIxOTliOWIyOQ==
4
+ YTRiZDA4ZDFhOWVkMjQ4ZGZiZTEyMzZmMzZmNjNiZjkyOWU3NDBjYw==
5
5
  data.tar.gz: !binary |-
6
- YmIzZDMzMjJlMTE5NTFjODNjYmE2OTI3ZjAzNDEzYzU0MzJhNGQ4NA==
6
+ N2UzNWJlOWMwYWIwNjY4ZjA1YTcxMGNjODc0NTUzMDk1MmQwYWY0Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MGUzMWUyODkyYzU1MGE4ODMyZWJhYWZmMGVkYzI4YjMzNGUwNDdhNTAzYjRh
10
- MzEyYTdhNTljZjMxY2I4ZWYxODZlNzc1NmYwYzcxYzA3MzAwNWUzOWI4MTU5
11
- NzE3NTEwMDhjY2JmNzY3N2I1YmUyMDkwNGViNTczN2I5Y2EwNDg=
9
+ NzI5N2VjZTVmMTg2ZWM3YTM2M2JjMmYwZDE0ODhjYzJiNTM3ZmI2NTEwYjU1
10
+ OTUzMDEwNTQ2NTAxMjQ0MjA0MmExNTg3Y2UwOTc1ZTY0MzM3ZWU2ZWM5ZGU1
11
+ OTc4ZGU2N2VlNGQ0NDUwOTQ1ZTMxY2E0ZDIxMzExYWNhZmU2NGM=
12
12
  data.tar.gz: !binary |-
13
- ZjE3NWYwYzIyOGY1ZTVhZjJkMGYwMGM2MDFiOGNiM2ZjNGQxMmVkNTkxMDFj
14
- MDY3Mjg2MTljYzJjZjMxNjE2NTRjYTRjMzU3NmY3NDM1ODJkODZlZDE0NGUw
15
- OGM4YjcxZmI0YmVkNDZlZTdmZjAyMmQyNTgxYjg1OTdmOTJhM2Q=
13
+ MWMyMmU4MjczMWM4YmUwMDJlMTlhZWI1MTg0ZDY0NjkyNDNhOTJmYjFmNjdk
14
+ ZDIyNDgxZjAzNTZmYmQyM2I3OTc5YTU0ZTBkNjgxN2RhMzFhYzU2ZTQ3NGQz
15
+ NTYyYjg4Y2VmMjU4M2I0ZWFhODQ1NGMyMTk1MzIzNmI2NWFlODk=
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
- ### 0.1.05 / 2014-02-20
1
+ ### 0.1.06 / 2014-02-20
2
+ * [CHANGE] Round of code style improvement complete.
3
+
4
+ ### 0.1.05 / 2014-02-19
2
5
  * [CHANGE] File `.rubocop.yml`. Updated, cop EmptyLinesAroundBody disabled.
3
6
  * [CHANGE] Style of several /lib files improved: `feature-model`, `feature-rep`, `file-action`, `gherkin-facade`, `hook-dsl`, `sandbox`.
4
7
 
@@ -12,7 +12,8 @@ module Cukedep # Module used as a namespace
12
12
  # Runner for the Cukedep application.
13
13
  class Application
14
14
  attr_reader(:proj_dir)
15
- public
15
+
16
+ public
16
17
 
17
18
  # Entry point for the application object.
18
19
  def run!(theCmdLineArgs)
@@ -44,7 +45,8 @@ public
44
45
  end
45
46
  end
46
47
 
47
- protected
48
+ protected
49
+
48
50
  # Retrieve the user-entered command-line options
49
51
  def options_from(theCmdLineArgs)
50
52
  cli = CLI::CmdLine.new
@@ -97,8 +99,10 @@ protected
97
99
 
98
100
  # Generate CSV files detailing the feature to identifier mapping
99
101
  # and vise versa
100
- # TODO: replace hardcoded names by value from config
101
- aModel.mapping_reports(aConfig.feature2id.name, aConfig.id2feature.name, true)
102
+ # TODO: replace hard-coded names by value from config
103
+ feature2id_report = aConfig.feature2id.name
104
+ id2feature_report = aConfig.id2feature.name
105
+ aModel.mapping_reports(feature2id_report, id2feature_report, true)
102
106
  aModel.draw_dependency_graph(aConfig.graph_file.name, true)
103
107
  aModel.generate_rake_tasks(aConfig.rake_file, proj_dir)
104
108
  end
@@ -26,7 +26,7 @@ class CmdLine
26
26
 
27
27
  # Constructor.
28
28
  def initialize()
29
- @options = { }
29
+ @options = {}
30
30
 
31
31
  @parser = OptionParser.new do |opts|
32
32
  opts.banner = <<-EOS
@@ -68,7 +68,8 @@ EOS
68
68
  end
69
69
  end
70
70
 
71
- public
71
+ public
72
+
72
73
  # Perform the command-line parsing
73
74
  def parse!(theCmdLineArgs)
74
75
  begin
@@ -88,7 +89,8 @@ public
88
89
  return options
89
90
  end
90
91
 
91
- private
92
+ private
93
+
92
94
  def validated_project(theProjectPath)
93
95
  unless Dir.exist?(theProjectPath)
94
96
  fail StandardError, "Cannot find the directory '#{theProjectPath}'."
@@ -44,18 +44,18 @@ class Config
44
44
 
45
45
  return instance
46
46
  end
47
-
48
-
47
+
48
+
49
49
  # Read the YAML file with specified name from the current working directory.
50
50
  # If that file does not exist, then return an instance with default values.
51
51
  def self.load_cfg(filename)
52
52
  # TODO: validation
53
- instance = File.exist?(filename) ? YAML.load_file(filename) : self.default
54
-
53
+ instance = File.exist?(filename) ? YAML.load_file(filename) : default
54
+
55
55
  return instance
56
56
  end
57
57
 
58
-
58
+
59
59
  # Save the Config object to a YAML file.
60
60
  def write(filename)
61
61
  File.open(filename, 'w') { |f| YAML.dump(self, f) }
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Cukedep # Module used as a namespace
5
5
  # The version number of the gem.
6
- Version = '0.1.05'
6
+ Version = '0.1.06'
7
7
 
8
8
  # Brief description of the gem.
9
9
  Description = 'Manage dependencies between Cucumber feature files'
@@ -36,7 +36,7 @@ module Cukedep # This module is used as a namespace
36
36
  class CukeRunner
37
37
  # The current state of the runner.
38
38
  attr_reader(:state)
39
-
39
+
40
40
  # The absolute path of the root's project directory
41
41
  attr_reader(:proj_dir)
42
42
  attr_reader(:base_dir)
@@ -51,14 +51,14 @@ class CukeRunner
51
51
  @proj_dir = validated_proj_dir(projectDir)
52
52
  @config = aConfig
53
53
  @handlers = Customization.new.build_handlers(baseDir)
54
-
54
+
55
55
  @state = :Initialized
56
56
  end
57
57
 
58
58
  # Launch Cucumber in the project directory.
59
59
  def invoke()
60
60
  options = [] # TODO: retrieve Cucumber options
61
- orig_dir = Dir.getwd()
61
+ orig_dir = Dir.getwd
62
62
  Dir.chdir(proj_dir)
63
63
 
64
64
  begin
@@ -66,7 +66,7 @@ class CukeRunner
66
66
  t.cucumber_opts = options
67
67
  end
68
68
 
69
- cuke_task.runner.run()
69
+ cuke_task.runner.run
70
70
  rescue SystemExit => exc # Cucumber reports a failure.
71
71
  raise StandardError, "Cucumber exited with status #{exc.status}"
72
72
  ensure
@@ -86,7 +86,7 @@ class CukeRunner
86
86
 
87
87
  # Execute before all hook code
88
88
  run_code_block
89
-
89
+
90
90
  # Execute file actions
91
91
  builtin_actions = ActionTriplet.builtin(:before_all)
92
92
  custom_actions = ActionTriplet.new(config.before_all_f_actions)
@@ -108,7 +108,7 @@ class CukeRunner
108
108
  builtin_actions = ActionTriplet.builtin(:after_all)
109
109
  custom_actions = ActionTriplet.new(config.after_all_f_actions)
110
110
  run_triplets([builtin_actions, custom_actions])
111
-
111
+
112
112
  # Execute before all hook code
113
113
  run_code_block
114
114
  @state = :Complete
@@ -124,20 +124,21 @@ class CukeRunner
124
124
 
125
125
 
126
126
  private
127
+
127
128
  def validated_proj_dir(projectDir)
128
129
  path = Pathname.new(projectDir)
129
130
  path = path.expand_path if path.relative?
130
131
  unless path.exist?
131
- raise StandardError, "No such project path: '#{path}'"
132
+ fail StandardError, "No such project path: '#{path}'"
132
133
  end
133
-
134
+
134
135
  return path.to_s
135
136
  end
136
-
137
+
137
138
  def expected_state(aState)
138
139
  unless state == aState
139
140
  msg = "expected state was '#{aState}' instead of '#{state}'."
140
- raise StandardError, msg
141
+ fail StandardError, msg
141
142
  end
142
143
  end
143
144
 
@@ -179,18 +180,18 @@ class CukeRunner
179
180
  # Do all copy actions...
180
181
  all_triplets.each { |t| t.copy_action.run!(base_dir, proj_dir) }
181
182
  end
182
-
183
+
183
184
 
184
185
  def run_code_block(*args)
185
186
  # Retrieve the name of the parent method.
186
- parent_mth = (caller[0].sub(/^(.+):in (.+)$/, "\\2"))[1..-2]
187
+ parent_mth = (caller[0].sub(/^(.+):in (.+)$/, '\2'))[1..-2]
187
188
  kind, scope = parent_mth.split('_')
188
189
  hook_kind = (kind + '_hooks')
189
-
190
+
190
191
  kode = handlers[hook_kind.to_sym][scope.to_sym]
191
192
  unless kode.nil?
192
193
  safe_args = args.map { |one_arg| one_arg.dup.freeze }
193
- kode.call(*safe_args)
194
+ kode.call(*safe_args)
194
195
  end
195
196
  end
196
197
 
@@ -199,4 +200,4 @@ end # class
199
200
 
200
201
  end # module
201
202
 
202
- # End of file
203
+ # End of file
@@ -19,7 +19,7 @@ module Cukedep # This module is used as a namespace
19
19
  obj.extend(HookDSL)
20
20
  hook_source = File.read(filepath)
21
21
  obj.instance_eval(hook_source)
22
- handlers = {
22
+ handlers = {
23
23
  before_hooks: obj.before_hooks,
24
24
  after_hooks: obj.after_hooks
25
25
  }
@@ -32,4 +32,4 @@ module Cukedep # This module is used as a namespace
32
32
 
33
33
  end # module
34
34
 
35
- # End of file
35
+ # End of file
@@ -1,8 +1,12 @@
1
1
  # File: cukedep.rake
2
- # Generated by Cukedep 0.1.01 on 27/11/2013 23:12:50
2
+ # Generated by Cukedep 0.1.05 on 20/02/2014 20:38:27
3
3
 
4
4
  require 'rake'
5
- require 'cukedep/file-action'
5
+
6
+
7
+ # Use development codebase
8
+ require_relative '../../../lib/cukedep/file-action'
9
+
6
10
 
7
11
  # Run Cucumber via specialized Rake task
8
12
  require 'cucumber/rake/task'
@@ -2,7 +2,7 @@
2
2
  // 'C:/Ruby193/lib/ruby/site_ruby/Cukedep/spec/cukedep/sample_features'
3
3
  // This file uses the DOT syntax, a free utility from the Graphviz toolset.
4
4
  // Graphviz is available at: www.graphviz.org
5
- // File generated on Wed Nov 27 23:12:50 2013.
5
+ // File generated on Thu Feb 20 20:38:27 2014.
6
6
 
7
7
  digraph g {
8
8
  size = "7, 11"; // Dimensions in inches...
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cukedep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.05
4
+ version: 0.1.06
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef