starter 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ Copyright (c) 2012 Matthew King
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+
9
+
10
+
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ $:.unshift("lib")
2
+ require "starter/tasks/gems"
3
+ require "starter/tasks/git"
4
+
5
+ task "build" => %w[ gem:build ]
6
+ task "release" => %w[ build gem:push tag ]
@@ -0,0 +1,35 @@
1
+ require "starter/tasks/helpers"
2
+
3
+ unless gemspec = FileList["*.gemspec"].first
4
+ raise "Could not find a gemspec in the working directory"
5
+ end
6
+
7
+ project_name = gemspec.chomp(".gemspec")
8
+
9
+ desc "build a gem using #{gemspec}"
10
+ task "gem:build" do
11
+ sh "gem build #{gemspec}"
12
+ end
13
+
14
+ task "gem:push" do
15
+ gemfiles = FileList["#{project_name}-*.gem"]
16
+ if gemfiles.size == 1
17
+ command = "gem push #{gemfiles.first}"
18
+ confirm_command(command)
19
+ else
20
+ puts "Found more than one gemfile in the working directory."
21
+ end
22
+ end
23
+
24
+ task "version" do
25
+ str = File.read(gemspec)
26
+ spec = eval(str)
27
+ ENV["version"] = spec.version.version
28
+ end
29
+
30
+ task "clean" do
31
+ FileList["#{project_name}-*.gem"].each do |file|
32
+ rm file
33
+ end
34
+ end
35
+
@@ -0,0 +1,18 @@
1
+ require "starter/tasks/helpers"
2
+
3
+ desc "Create a git tag using the project version"
4
+ # Note that the user of this library must ensure that a task named
5
+ # "version" is defined before invocation time.
6
+ task "tag" => "version" do
7
+ version = ENV["version"]
8
+ git_tag = `git tag -l #{version}`.chomp
9
+ if git_tag == version
10
+ puts "Tag #{version} already exists. Bump the version in the gemspec."
11
+ else
12
+ message = ENV["message"] || version
13
+ command = "git tag -am #{message} #{version}"
14
+ confirm_command(command)
15
+ end
16
+ end
17
+
18
+
@@ -0,0 +1,12 @@
1
+
2
+ def confirm_command(command)
3
+ print "Issue command '#{command}' [y/N] "
4
+ case STDIN.gets.chomp
5
+ when /^y/i
6
+ sh command
7
+ else
8
+ puts "Cancelled."
9
+ exit
10
+ end
11
+ end
12
+
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: starter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Matthew King
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description:
15
+ email:
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - Rakefile
22
+ - README.md
23
+ - lib/starter/tasks/gems.rb
24
+ - lib/starter/tasks/git.rb
25
+ - lib/starter/tasks/helpers.rb
26
+ homepage: https://github.com/automatthew/starter
27
+ licenses: []
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 1.8.23
47
+ signing_key:
48
+ specification_version: 3
49
+ summary: Generally useful and reusable things
50
+ test_files: []