cog-rb 0.3.2 → 0.3.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 861e88d4018ad9f506ed5ef6269fc35f2faaa5f7
4
- data.tar.gz: ebf126f7e79f2ffa305b90d0c6effc3ad62e778b
3
+ metadata.gz: 085d788c6aa8b12e85f39eef44318fe46eb3a6b6
4
+ data.tar.gz: 56d0d6d2e2137f05461a245747a8d01a942fc1c6
5
5
  SHA512:
6
- metadata.gz: c69220a7ecb2c88b1e9a7fe6f9ae7d8aea56ba0d60f46e76a0717d673703c3df7c99761cbc57a06a86f96bd413779d04c25f41498586e983255732219d6904b6
7
- data.tar.gz: 5b844d99006f5f3d9d8d679090fb9471012904966b9e201c3b4fc94b33d8d364d5527b73aa82b2fceab255f0653cb7b5f67961a538d16dc4af501fd142ae7cb4
6
+ metadata.gz: e00e4960ca30076bcb01e4a5c4232614a9640a5a281d3e87a6e5e77209649ebc23f45bea1d02cc2f3040ce70d60c0b882b6cde261f48eb4f1627210ed8c45e1f
7
+ data.tar.gz: 6a41cd905dca14cee141829067e5355133304d4179bc045dc572134f152668400b6c5472fad0891117fd943650870d13a9a7aace2d984e6c7275d4511c18f595
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.3
2
+
3
+ * Bugfix to allow rspec support to work with current Cog::Bundle API
4
+ * Bugfix to skip creation of intermediate modules in the command hierarchy if they are already defined
5
+
1
6
  ## 0.3.2
2
7
 
3
8
  The 0.3.1 release inadvertently omitted the `docker:release` task. This has been corrected.
data/lib/cog/bundle.rb CHANGED
@@ -9,9 +9,15 @@ class Cog
9
9
  end
10
10
 
11
11
  def create_bundle_module
12
- return if Object.const_defined?('CogCmd')
13
- Object.const_set('CogCmd', Module.new)
14
- CogCmd.const_set(@name.capitalize, Module.new)
12
+ module_name = @name.capitalize
13
+
14
+ Object.const_set('CogCmd', Module.new) unless Object.const_defined?('CogCmd')
15
+
16
+ if CogCmd.const_defined?(module_name)
17
+ CogCmd.const_get(module_name)
18
+ else
19
+ CogCmd.const_set(module_name, Module.new)
20
+ end
15
21
  end
16
22
 
17
23
  def command_instance(command_name)
data/lib/cog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cog
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -33,20 +33,13 @@ module Cog::RSpec::Setup
33
33
  # This is `let!` instead of `let` because this call actually
34
34
  # *creates* the bundle module that our commands live in; we want
35
35
  # to ensure that this gets called before we start doing anything else
36
- Cog::Bundle.new(bundle_name, base_dir: base_dir, config_file: config_file)
36
+ Cog::Bundle.new(bundle_name, base_dir: base_dir)
37
37
  end
38
38
 
39
39
  let(:command_name){ raise "Must supply a :command_name!" }
40
40
 
41
41
  let(:command) do
42
- # translate snake-case command names to camel case
43
- command_class = command_name.gsub(/(\A|_)([a-z])/) { $2.upcase }
44
-
45
- # convert hyphenated command names into class hierarchies,
46
- # e.g. template-list becomes Template::List.
47
- command_class = command_class.split('-').map{ |seg| seg.capitalize }.join('::')
48
-
49
- Object.const_get("CogCmd::#{bundle_name.capitalize}::#{command_class}").new
42
+ bundle.command_instance(command_name)
50
43
  end
51
44
 
52
45
  let(:invocation_id) { SecureRandom.uuid }
data/lib/tasks/cog.rake CHANGED
@@ -1,10 +1,10 @@
1
- config_file = FileList.new('config.y?ml').first
1
+ config_file = FileList.new("config.y*ml").first
2
2
  config = Cog::Config.new(config_file)
3
3
  docker_image = config['docker'].nil? ? nil : "#{config['docker']['image']}:#{config['docker']['tag']}"
4
4
 
5
5
  namespace :template do
6
6
  desc "Update templates in configuration file"
7
- task :update do
7
+ task :update, [ :mode ] do |t, args|
8
8
  puts "Current bundle configuration version is #{config['version']}."
9
9
 
10
10
  templates = FileList.new('templates/*')
@@ -26,7 +26,7 @@ namespace :template do
26
26
  end
27
27
 
28
28
  if config.stale?
29
- config.update_version
29
+ config.update_version unless args[:mode] == 'dev'
30
30
  puts "Writing new configuration file for version #{config['version']}."
31
31
  config.save
32
32
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cog-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Imbriaco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake