skellington 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +20 -19
- data/features/hyphens.feature +27 -0
- data/lib/skellington/generator.rb +14 -5
- data/lib/skellington/version.rb +1 -1
- data/lib/templates/post-run.eruby +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3539e4dd5332068e47445bf3132f8f3a4274b5e
|
4
|
+
data.tar.gz: 2de4b79f72099f5cea933724adfa2af9faa90826
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15c94756c1749f87ace4e5eef0dd356ffbe356f3ed447dd2f6aebabe2e315ea0ee50e137a67330c05ac114a439cda9211a6f963c429faf9225e519569a7b8309
|
7
|
+
data.tar.gz: 20f36a612598de984bad7a6daccff515631a705c66d42ddcd45f96bed9129735892bfc99abacfee19ce83c8b5de9b73da7e79abe960e7b82499347bb05edf180
|
data/README.md
CHANGED
@@ -11,33 +11,34 @@
|
|
11
11
|
Generate tedious [Cucumber](http://cukes.info/) and [Sinatra](http://www.sinatrarb.com/) boilerplate like a boss. Should work fine for both RVM- and rbenv-based setups
|
12
12
|
|
13
13
|
$ gem install skellington
|
14
|
-
$ skellington generate
|
14
|
+
$ skellington generate naming-things-is-hard
|
15
|
+
Generating naming_things_is_hard/Gemfile...done
|
16
|
+
Generating naming_things_is_hard/Rakefile...done
|
17
|
+
Generating naming_things_is_hard/Procfile...done
|
18
|
+
Generating naming_things_is_hard/.ruby-version...done
|
19
|
+
Generating naming_things_is_hard/config.ru...done
|
20
|
+
Generating naming_things_is_hard/features/naming_things_is_hard.feature...done
|
21
|
+
Generating naming_things_is_hard/features/support/env.rb...done
|
22
|
+
Generating naming_things_is_hard/lib/naming_things_is_hard.rb...done
|
15
23
|
|
16
|
-
|
17
|
-
Generating naming_things_is_hard/Rakefile...done
|
18
|
-
Generating naming_things_is_hard/Procfile...done
|
19
|
-
Generating naming_things_is_hard/config.ru...done
|
20
|
-
Generating naming_things_is_hard/features/naming_things_is_hard.feature...done
|
21
|
-
Generating naming_things_is_hard/features/support/env.rb...done
|
22
|
-
Generating naming_things_is_hard/lib/naming_things_is_hard.rb...done
|
23
|
-
Generating naming_things_is_hard/.ruby-version...done
|
24
|
+
Your new Sinatra app NamingThingsIsHard has been created
|
24
25
|
|
25
|
-
|
26
|
+
(Note that 'naming-things-is-hard' has been changed to 'naming_things_is_hard' because Ruby finds '-'s troubling)
|
26
27
|
|
27
|
-
|
28
|
+
Now do
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
cd naming_things_is_hard
|
31
|
+
bundle
|
32
|
+
rake
|
32
33
|
|
33
|
-
|
34
|
+
And presuming that passes OK
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
git add .
|
37
|
+
git commit -m 'First commit'
|
37
38
|
|
38
|
-
|
39
|
+
You can run the app with
|
39
40
|
|
40
|
-
|
41
|
+
rackup
|
41
42
|
|
42
43
|
This assumes a bunch of things, at least:
|
43
44
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Generate skellington
|
2
|
+
|
3
|
+
Scenario: change the names if there are hyphens
|
4
|
+
When I successfully run `skellington generate hyphenated-name`
|
5
|
+
Then the output should contain "Generating hyphenated_name/Gemfile"
|
6
|
+
And the output should contain "bundle"
|
7
|
+
And the output should contain:
|
8
|
+
"""
|
9
|
+
Your new Sinatra app HyphenatedName has been created
|
10
|
+
|
11
|
+
(Note that 'hyphenated-name' has been changed to 'hyphenated_name' because Ruby finds '-'s troubling)
|
12
|
+
|
13
|
+
Now do
|
14
|
+
|
15
|
+
cd hyphenated_name
|
16
|
+
bundle
|
17
|
+
rake
|
18
|
+
|
19
|
+
And presuming that passes OK
|
20
|
+
|
21
|
+
git add .
|
22
|
+
git commit -m 'First commit'
|
23
|
+
|
24
|
+
You can run the app with
|
25
|
+
|
26
|
+
rackup
|
27
|
+
"""
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module Skellington
|
2
2
|
class Generator
|
3
|
-
attr_reader :path, :
|
3
|
+
attr_reader :path, :filename, :camelname, :files, :gems
|
4
4
|
|
5
5
|
def initialize path
|
6
|
-
@
|
7
|
-
@
|
8
|
-
@
|
6
|
+
@full_path = path
|
7
|
+
@path = File.dirname @full_path
|
8
|
+
@filename = File.basename(@full_path)
|
9
|
+
@camelname = Skellington.camelise(wormname)
|
9
10
|
@gems = config['gems']
|
10
11
|
@files = config['files']
|
11
12
|
end
|
@@ -27,8 +28,16 @@ module Skellington
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
31
|
+
def wormname
|
32
|
+
@filename.gsub('-', '_')
|
33
|
+
end
|
34
|
+
|
35
|
+
def renamed
|
36
|
+
@filename != wormname
|
37
|
+
end
|
38
|
+
|
30
39
|
def git_init
|
31
|
-
Git.init
|
40
|
+
Git.init wormname
|
32
41
|
end
|
33
42
|
|
34
43
|
def post_run
|
data/lib/skellington/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skellington
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pikesley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- features/cukes.feature
|
189
189
|
- features/gemfile.feature
|
190
190
|
- features/git.feature
|
191
|
+
- features/hyphens.feature
|
191
192
|
- features/naming.feature
|
192
193
|
- features/non-local-path.feature
|
193
194
|
- features/procfile.feature
|
@@ -243,6 +244,7 @@ test_files:
|
|
243
244
|
- features/cukes.feature
|
244
245
|
- features/gemfile.feature
|
245
246
|
- features/git.feature
|
247
|
+
- features/hyphens.feature
|
246
248
|
- features/naming.feature
|
247
249
|
- features/non-local-path.feature
|
248
250
|
- features/procfile.feature
|