blam 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ruby-2.0.0-p247
1
+ ruby-2.0.0
@@ -1,3 +1,6 @@
1
+ #1.2.0 (2013-12-02)
2
+ - added the `--init` option to create a default `.blam` file
3
+
1
4
  #1.1.0 (2013-10-08)
2
5
  - added `--no-tests` and `--just-unit` flags
3
6
 
data/README.md CHANGED
@@ -64,6 +64,7 @@ end
64
64
  - **--additional-test-dirs** - Add other directories to create additional test files. This can be helpful for breaking up your tests into folders like `spec/unit` `spec/integration`
65
65
  - **--no-tests** - Regardless of your settings it will not create the test files. This is bad. And you are lazy for using this option.
66
66
  - **--just-unit** - This will not create files if you have specified additional test directories, helpful when you just want a unit test and don't need an integration test as well.
67
+ - **--init** - Create a default `.blam` file as detailed below.
67
68
 
68
69
  ###.blam File
69
70
 
@@ -76,6 +77,8 @@ source_dir: lib
76
77
  test_suffix: spec
77
78
  ```
78
79
 
80
+ To initialize a default file for your project, just run `blam --init`
81
+
79
82
  Don't worry, you can override these with the command line options any time. Blam!
80
83
 
81
84
  ## Contributing
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'blam'
8
- spec.version = '1.1.0'
8
+ spec.version = '1.2.0'
9
9
  spec.authors = ['Jason Fox']
10
10
  spec.email = ['jasonrobertfox@gmail.com']
11
11
  spec.description = %q{Blam: quickly create ruby source and test files in the right place.}
@@ -54,6 +54,17 @@ Scenario: Specifying default settings with a .blam file
54
54
  | spec/integration/lib/name_space/class_name_test.rb |
55
55
  | spec/system/lib/name_space/class_name_test.rb |
56
56
 
57
+ Scenario: Initializing a .blam file
58
+ Given I run `bundle exec blam --init`
59
+ Then the file ".blam" should contain exactly:
60
+ """
61
+ tests_dir: spec/unit/lib
62
+ source_dir: lib
63
+ test_suffix: spec
64
+ # additional_test_dirs: [spec/integration/lib, spec/system/lib]
65
+
66
+ """
67
+
57
68
  Scenario: Overriding the .blam file with cli options
58
69
  Given a file named ".blam" with:
59
70
  """
@@ -4,7 +4,6 @@ require 'thor/group'
4
4
  require 'yaml'
5
5
 
6
6
  class Blam < Thor::Group
7
-
8
7
  include Thor::Actions
9
8
 
10
9
  argument :name
@@ -20,6 +19,14 @@ class Blam < Thor::Group
20
19
  File.dirname(__FILE__)
21
20
  end
22
21
 
22
+ def init
23
+ if name == '--init'
24
+ file_name = '.blam'
25
+ template('templates/blam.tt', file_name) unless File.exists?(file_name)
26
+ exit(0)
27
+ end
28
+ end
29
+
23
30
  def create_source_file
24
31
  dir = opts[:source_dir]
25
32
  @class_parts = name.split('::')
@@ -34,7 +41,7 @@ class Blam < Thor::Group
34
41
  dirs = [opts[:tests_dir]]
35
42
  test_suffix = opts[:test_suffix]
36
43
  test_template = test_suffix == 'spec' ? 'rspec' : 'test'
37
- dirs.concat opts[:additional_test_dirs] if opts[:additional_test_dirs] && ! opts[:just_unit]
44
+ dirs.concat opts[:additional_test_dirs] if opts[:additional_test_dirs] && !opts[:just_unit]
38
45
  dirs.each do |dir|
39
46
  @name = name
40
47
  @path = get_path(name)
@@ -0,0 +1,4 @@
1
+ tests_dir: spec/unit/lib
2
+ source_dir: lib
3
+ test_suffix: spec
4
+ # additional_test_dirs: [spec/integration/lib, spec/system/lib]
metadata CHANGED
@@ -1,86 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blam
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Jason Fox
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-10-09 00:00:00.000000000 Z
12
+ date: 2013-12-02 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: aruba
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rubocop
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: thor
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
- description: 'Blam: quickly create ruby source and test files in the right place.'
94
+ description: ! 'Blam: quickly create ruby source and test files in the right place.'
84
95
  email:
85
96
  - jasonrobertfox@gmail.com
86
97
  executables:
@@ -103,32 +114,34 @@ files:
103
114
  - features/default.feature
104
115
  - features/support/env.rb
105
116
  - lib/blam.rb
117
+ - lib/templates/blam.tt
106
118
  - lib/templates/rspec.tt
107
119
  - lib/templates/source.tt
108
120
  - lib/templates/test.tt
109
121
  homepage: https://github.com/neverstopbuilding/blam
110
122
  licenses:
111
123
  - MIT
112
- metadata: {}
113
124
  post_install_message:
114
125
  rdoc_options: []
115
126
  require_paths:
116
127
  - lib
117
128
  required_ruby_version: !ruby/object:Gem::Requirement
129
+ none: false
118
130
  requirements:
119
- - - '>='
131
+ - - ! '>='
120
132
  - !ruby/object:Gem::Version
121
133
  version: '0'
122
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
+ none: false
123
136
  requirements:
124
- - - '>='
137
+ - - ! '>='
125
138
  - !ruby/object:Gem::Version
126
139
  version: '0'
127
140
  requirements: []
128
141
  rubyforge_project:
129
- rubygems_version: 2.0.3
142
+ rubygems_version: 1.8.25
130
143
  signing_key:
131
- specification_version: 4
144
+ specification_version: 3
132
145
  summary: With a single command Blam will create your source file and any test files
133
146
  in the right directories based on namespace.
134
147
  test_files:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 31009b908445b5df457b02052a723b47fce3a438
4
- data.tar.gz: 62c14dec3e106ce2d9c8f5358f2b57aec1db0a46
5
- SHA512:
6
- metadata.gz: 50b15cfe33eb0344aa93056014c3af9009146ae04524d2adfcfb6f806af5df3663d74eb0a7db3aecd756e2b9aa4e69f6ee2a8db73590a31067881d270635066b
7
- data.tar.gz: 6de192cacd7c3a94331c6e42c443e85d009083db764adb55be4666da780b432b41e5984b14fe2e990975c916ee919a5e736479a331f9c4c54054c6cc2d01a4ef