gem_template 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a3777377d78c837ce5da75bb623df9d0663595f
4
- data.tar.gz: 6c15d1af9df7e0c3eeae1136b3eef93681d97e12
3
+ metadata.gz: 8187e92dd3fc04d2e3631cda7bd426321c21a996
4
+ data.tar.gz: f5e9bc7b90a9d217aa3ca50d344e1ab3a84bd8be
5
5
  SHA512:
6
- metadata.gz: e6275956d013a85eef47255e1f61883697eb34d6152308e402de5c5dfdf687c7aa889565417a4b5513aeb2056e960e994bdee54f3b3ed317df36fb48ff42492d
7
- data.tar.gz: b4e7b5defec94cfd89e8974cd16cfa8e6d50852ef2bdc1bd3e851726074139c3b2f5cea5ae4714bcaef0843ce96029d0b64c6302021e080c5433367a6088295e
6
+ metadata.gz: 5ff6df2b121e53abe518b5ed486f18c8b4b7d4118833fe29efd5b468d7fb702933e770dcf6ca5240dbad81a06982c377c3d166b28d8505b7416c44d2d5f32d98
7
+ data.tar.gz: ab2b48a56b033cb4846ce0c46f9459d65882c2c0d46ffeef89fbc684342c871aaf9dc6b1825666142ecf8e558e1de60625e29cec10a4cb57e5f4e2d01c4396bf
data/README.md CHANGED
@@ -15,7 +15,7 @@ A gem template for new Ruby projects.
15
15
 
16
16
  ###Create a new project
17
17
 
18
- gem_template [project_name] [ProjectName] [branch...]
18
+ gem_template [project_name] [branch]...
19
19
 
20
20
  ###Available branches
21
21
 
data/bin/gem_template CHANGED
@@ -1,37 +1,40 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env ruby
2
2
 
3
- echo ""
4
- git clone 'https://github.com/winton/gem_template.git' $1
3
+ dirname = ARGV[0]
4
+ classname = ARGV[0].gsub(/(^.|_.)/) { |s| s[-1..-1].upcase }
5
5
 
6
- if [ $? -eq 0 ]; then
7
- cd $1
8
- else
9
- exit 1
10
- fi
6
+ puts ""
7
+ exit unless system(
8
+ "git clone https://github.com/winton/gem_template.git #{dirname}"
9
+ )
11
10
 
12
- echo -e "\nFetching..."
13
- git fetch
11
+ Dir.chdir(dirname) do
12
+ puts "\nFetching..."
13
+ system("git fetch")
14
14
 
15
- echo -e "\nWriting .ruby-gemset..."
16
- echo $1 > .ruby-gemset
15
+ puts "\nWriting .ruby-gemset..."
16
+ system("echo #{dirname} > .ruby-gemset")
17
17
 
18
- echo -e "\nInstalling base gems..."
19
- gem install bundler && bundle
18
+ puts "\nWriting .ruby-version..."
19
+ system("echo #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} > .ruby-version")
20
20
 
21
- echo -e "\nGemTemplate -> $2..."
22
- namer gem_template:$1 GemTemplate:$2
21
+ puts "\nInstalling namer..."
22
+ system("gem install namer")
23
23
 
24
- echo ""
25
- echo $'\e[1;31m'"To finish setting up your project:"
26
- echo $'\e[0m'
27
- echo " cd $1"
24
+ puts "\nGemTemplate -> #{classname}..."
25
+ system("namer gem_template:#{dirname} GemTemplate:#{classname}")
28
26
 
29
- for i in ${@:3}; do
30
- echo " git merge origin/$i"
31
- done
27
+ puts "\nMerging branches..."
28
+ ARGV[1..-1].each do |branch|
29
+ system("git merge origin/#{branch}")
30
+ end
31
+ end
32
32
 
33
- echo " bundle"
34
- echo ""
33
+ puts ""
34
+ puts "\e[32mTo finish setting up your project:\e[0m"
35
+ puts " cd #{dirname}"
36
+ puts " bundle"
37
+ puts ""
35
38
 
36
39
  # -- replace
37
40
  # #!/usr/bin/env ruby
data/gem_template.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "gem_template"
7
- spec.version = "0.0.3"
7
+ spec.version = "0.0.4"
8
8
  spec.authors = ["Winton Welsh"]
9
9
  spec.email = ["mail@wintoni.us"]
10
10
  spec.description = %q{Gem template for new Ruby projects}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winton Welsh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-19 00:00:00.000000000 Z
11
+ date: 2013-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: namer