hq-dev 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/hq-dev-init +119 -0
  2. data/bin/hq-dev-release +44 -0
  3. metadata +145 -0
data/bin/hq-dev-init ADDED
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "fileutils"
4
+
5
+ PROJECT = File.basename(Dir.pwd)
6
+ DEV_DIR = File.expand_path "../..", __FILE__
7
+
8
+ def shell cmd
9
+ success = system cmd
10
+ exit 1 unless success
11
+ end
12
+
13
+ def write_file name, lines
14
+
15
+ File.open name, "w" do
16
+ |file_io|
17
+
18
+ lines.each do
19
+ |line|
20
+
21
+ file_io.puts line
22
+
23
+ end
24
+
25
+ end
26
+
27
+ end
28
+
29
+ gem_versions = Hash[
30
+ File.new("#{DEV_DIR}/data/gem-versions")
31
+ .to_a
32
+ .map { |line| line.split " " }
33
+ ]
34
+
35
+ puts "creating Rakefile"
36
+ FileUtils.copy_entry "#{DEV_DIR}/templates/rakefile", "Rakefile"
37
+
38
+ puts "creating #{PROJECT}.gemspec"
39
+ FileUtils.copy_entry "#{DEV_DIR}/templates/gemspec", "#{PROJECT}.gemspec"
40
+
41
+ puts "creating Gemfile"
42
+ FileUtils.copy_entry "#{DEV_DIR}/templates/gemfile", "Gemfile"
43
+
44
+ if File.exist? ".gitignore"
45
+ puts "not touching .gitignore"
46
+ else
47
+ puts "creating .gitignore"
48
+ FileUtils.copy_entry "#{DEV_DIR}/templates/gemfile", ".gitignore"
49
+ end
50
+
51
+ if File.exist? ".travis.yml"
52
+ puts "not touching .travis.yml"
53
+ else
54
+ puts "creating .travis.yml"
55
+ FileUtils.copy_entry "#{DEV_DIR}/templates/travis", ".travis.yml"
56
+ end
57
+
58
+ unless Dir.exist? ".hq-dev"
59
+ puts "creating .hq-dev"
60
+ FileUtils.mkdir ".hq-dev"
61
+ end
62
+
63
+ puts "creating .hq-dev/name"
64
+ write_file ".hq-dev/name", [ PROJECT ]
65
+
66
+ if File.exist? ".hq-dev/dependencies"
67
+ puts "not touching .hq-dev/dependencies"
68
+ else
69
+ puts "creating .hq-dev/dependencies"
70
+ write_file ".hq-dev/dependencies", []
71
+ end
72
+
73
+ if File.exist? ".hq-dev/development-dependencies"
74
+
75
+ puts "not touching .hq-dev/development-dependencies"
76
+
77
+ else
78
+
79
+ puts "creating .hq-dev/development-dependencies"
80
+
81
+ default_development_dependencies =
82
+ File.new("#{DEV_DIR}/data/default-development-dependencies")
83
+ .to_a
84
+ .map { |line| line.strip }
85
+ .map {
86
+ |name|
87
+
88
+ raise "no version for gem #{name}" \
89
+ unless gem_versions[name]
90
+
91
+ "#{name} #{gem_versions[name]}"
92
+
93
+ }
94
+
95
+ write_file \
96
+ ".hq-dev/development-dependencies",
97
+ default_development_dependencies
98
+
99
+ end
100
+
101
+ found_problem = false
102
+
103
+ if File.exist? ".hq-dev/full-name"
104
+ puts "not touching .hq-dev/full-name"
105
+ else
106
+ puts "PLEASE CREATE: .hq-dev/full-name"
107
+ found_problem = true
108
+ end
109
+
110
+ if File.exist? ".hq-dev/description"
111
+ puts "not touching .hq-dev/description"
112
+ else
113
+ puts "PLEASE CREATE: .hq-dev/description"
114
+ found_problem = true
115
+ end
116
+
117
+ unless found_problem
118
+ puts "done!"
119
+ end
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ project = File.basename(Dir.pwd)
4
+ ver = ARGV[0]
5
+
6
+ def shell cmd
7
+ success = system cmd
8
+ exit 1 unless success
9
+ end
10
+
11
+ # TODO check the workspace is clean
12
+
13
+ puts ""
14
+ puts "running tests"
15
+ shell "bundle exec rake"
16
+
17
+ puts ""
18
+ puts "bumping version number"
19
+ shell "echo #{ver} > .hq-dev/version"
20
+
21
+ puts ""
22
+ puts "running bundle update"
23
+ shell "bundle update"
24
+
25
+ puts ""
26
+ puts "committing changes"
27
+ shell "git add -A"
28
+ shell "git diff --cached"
29
+ sleep 2
30
+ shell "git commit -m 'bump version number to #{ver}'"
31
+
32
+ puts ""
33
+ puts "pushing to github"
34
+ shell "git tag #{ver}"
35
+ shell "git push origin master #{ver}"
36
+
37
+ puts ""
38
+ puts "pushing to rubygems"
39
+ shell "gem build #{project}.gemspec"
40
+ shell "gem push #{project}-#{ver}.gem"
41
+
42
+ puts ""
43
+ puts "done!"
44
+ puts ""
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hq-dev
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - James Pharaoh
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cucumber
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.3.1
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.3.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.7.7
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.7.7
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: 10.0.4
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 10.0.4
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 2.13.0
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 2.13.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec_junit_formatter
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: 0.1.6
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 0.1.6
94
+ - !ruby/object:Gem::Dependency
95
+ name: simplecov
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 0.7.1
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 0.7.1
110
+ description: HQ development tools
111
+ email:
112
+ - james@phsys.co.uk
113
+ executables:
114
+ - hq-dev-release
115
+ - hq-dev-init
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - bin/hq-dev-release
120
+ - bin/hq-dev-init
121
+ homepage: https://github.com/jamespharaoh/hq-dev
122
+ licenses: []
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: 1.3.6
139
+ requirements: []
140
+ rubyforge_project: hq-dev
141
+ rubygems_version: 1.8.23
142
+ signing_key:
143
+ specification_version: 3
144
+ summary: HQ dev
145
+ test_files: []