parka 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ module Somegem
2
+ VERSION = "0.1"
3
+ end
@@ -0,0 +1,12 @@
1
+ # this is only necessary to build from trunk rather than a release
2
+ $:.unshift File.expand_path("../../lib", __FILE__)
3
+
4
+ require "rubygems"
5
+ require "parka/specification"
6
+
7
+ Parka::Specification.new do |gem|
8
+ gem.name = "somegem"
9
+ gem.version = Somegem::VERSION
10
+ gem.summary = "A sample gem"
11
+ gem.homepage = "http://example.org"
12
+ end
data/lib/parka.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Parka
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
4
4
 
data/lib/parka/cli.rb CHANGED
@@ -34,6 +34,9 @@ class Parka::CLI < Thor
34
34
 
35
35
  desc "push [GEMSPEC]", "Build the gem and push it to GitHub and RubyGems.org"
36
36
 
37
+ method_option :create, :type => :boolean, :aliases => "-c",
38
+ :desc => "Create a Github repository for this project"
39
+
37
40
  def push(gemspec_filename=nil)
38
41
  gemspec = Gem::Specification.load(gemspec_filename || default_gemspec)
39
42
  gemfile = build(gemspec_filename)
@@ -45,15 +48,17 @@ class Parka::CLI < Thor
45
48
  end
46
49
 
47
50
  # create github repo
48
- repos = github_repositories
49
- names = repos.map { |repo| repo["name"] }
50
- unless names.include?(gemspec.name)
51
- github["repos/create"].post(
52
- :name => gemspec.name,
53
- :description => gemspec.summary,
54
- :homepage => gemspec.homepage,
55
- :public => "1"
56
- )
51
+ if options[:create]
52
+ begin
53
+ github["repos/create"].post(
54
+ :name => gemspec.name,
55
+ :description => gemspec.summary,
56
+ :homepage => gemspec.homepage,
57
+ :public => "1"
58
+ )
59
+ rescue
60
+ error "Unable to create GitHub repository: #{gemspec.name}"
61
+ end
57
62
  end
58
63
 
59
64
  # create release tag
@@ -8,7 +8,7 @@ class Parka::Specification < Gem::Specification
8
8
  gemspec_filename = caller.first.split(':').first
9
9
 
10
10
  # add the lib/ dir of the gem to the load path
11
- $:.unshift File.join(File.dirname(gemspec_filename), 'lib')
11
+ $:.unshift File.expand_path(File.join(File.dirname(gemspec_filename), 'lib'))
12
12
 
13
13
  # autorequire the same name as the gem spec
14
14
  require File.basename(gemspec_filename, File.extname(gemspec_filename))
@@ -0,0 +1,2 @@
1
+ require "spec_helper"
2
+ require "parka/cli"
@@ -0,0 +1,28 @@
1
+ require "spec_helper"
2
+ require "parka/specification"
3
+
4
+ describe Parka::Specification do
5
+
6
+ describe "initializer" do
7
+ let(:spec) { Parka::Specification.new }
8
+
9
+ it "sets defaults" do
10
+ mock($:).unshift(File.expand_path("../../parka/lib", __FILE__))
11
+
12
+ mock(Parka::Specification).require("specification_spec")
13
+ mock(Parka::Specification).default_author.returns("default_author")
14
+ mock(Parka::Specification).default_email.returns("default_email")
15
+ mock(Parka::Specification).add_bundler_dependencies.with_any_args
16
+
17
+ any_instance_of(Gem::Specification) do |spec|
18
+ stub(spec).summary.returns("default_description")
19
+ end
20
+
21
+ spec.author.should == "default_author"
22
+ spec.email.should == "default_email"
23
+ spec.description.should == "default_description"
24
+ spec.rubyforge_project == "nowarning"
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,8 @@
1
+ require "spec_helper"
2
+ require "parka"
3
+
4
+ describe Parka do
5
+ it "has a VERSION" do
6
+ Parka::VERSION.should_not be_nil
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ require "rspec"
2
+
3
+ Rspec.configure do |config|
4
+ config.color_enabled = true
5
+ config.mock_with :rr
6
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parka
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
4
+ hash: 7
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
8
+ - 6
9
9
  - 0
10
- version: 0.5.0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - |
@@ -17,10 +17,12 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-09-07 00:00:00 -04:00
20
+ date: 2011-02-14 00:00:00 -05:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
+ prerelease: false
25
+ type: :development
24
26
  requirement: &id001 !ruby/object:Gem::Requirement
25
27
  none: false
26
28
  requirements:
@@ -30,11 +32,11 @@ dependencies:
30
32
  segments:
31
33
  - 0
32
34
  version: "0"
33
- type: :development
34
- prerelease: false
35
- name: parka
36
35
  version_requirements: *id001
36
+ name: rake
37
37
  - !ruby/object:Gem::Dependency
38
+ prerelease: false
39
+ type: :development
38
40
  requirement: &id002 !ruby/object:Gem::Requirement
39
41
  none: false
40
42
  requirements:
@@ -44,11 +46,11 @@ dependencies:
44
46
  segments:
45
47
  - 0
46
48
  version: "0"
47
- type: :development
48
- prerelease: false
49
- name: rake
50
49
  version_requirements: *id002
50
+ name: rcov
51
51
  - !ruby/object:Gem::Dependency
52
+ prerelease: false
53
+ type: :development
52
54
  requirement: &id003 !ruby/object:Gem::Requirement
53
55
  none: false
54
56
  requirements:
@@ -58,11 +60,11 @@ dependencies:
58
60
  segments:
59
61
  - 0
60
62
  version: "0"
61
- type: :development
62
- prerelease: false
63
- name: rcov
64
63
  version_requirements: *id003
64
+ name: rr
65
65
  - !ruby/object:Gem::Dependency
66
+ prerelease: false
67
+ type: :development
66
68
  requirement: &id004 !ruby/object:Gem::Requirement
67
69
  none: false
68
70
  requirements:
@@ -76,11 +78,11 @@ dependencies:
76
78
  - beta
77
79
  - 19
78
80
  version: 2.0.0.beta.19
79
- type: :development
80
- prerelease: false
81
- name: rspec
82
81
  version_requirements: *id004
82
+ name: rspec
83
83
  - !ruby/object:Gem::Dependency
84
+ prerelease: false
85
+ type: :runtime
84
86
  requirement: &id005 !ruby/object:Gem::Requirement
85
87
  none: false
86
88
  requirements:
@@ -90,11 +92,11 @@ dependencies:
90
92
  segments:
91
93
  - 0
92
94
  version: "0"
93
- type: :runtime
94
- prerelease: false
95
- name: crack
96
95
  version_requirements: *id005
96
+ name: crack
97
97
  - !ruby/object:Gem::Dependency
98
+ prerelease: false
99
+ type: :runtime
98
100
  requirement: &id006 !ruby/object:Gem::Requirement
99
101
  none: false
100
102
  requirements:
@@ -104,11 +106,11 @@ dependencies:
104
106
  segments:
105
107
  - 0
106
108
  version: "0"
107
- type: :runtime
108
- prerelease: false
109
- name: rest-client
110
109
  version_requirements: *id006
110
+ name: rest-client
111
111
  - !ruby/object:Gem::Dependency
112
+ prerelease: false
113
+ type: :runtime
112
114
  requirement: &id007 !ruby/object:Gem::Requirement
113
115
  none: false
114
116
  requirements:
@@ -118,10 +120,8 @@ dependencies:
118
120
  segments:
119
121
  - 0
120
122
  version: "0"
121
- type: :runtime
122
- prerelease: false
123
- name: thor
124
123
  version_requirements: *id007
124
+ name: thor
125
125
  description: Simple gem building using bundler
126
126
  email: |
127
127
  <ddollar@gmail.com>
@@ -135,10 +135,16 @@ extra_rdoc_files: []
135
135
  files:
136
136
  - bin/parka
137
137
  - README.md
138
+ - data/example/lib/somegem.rb
139
+ - data/example/somegem.gemspec
138
140
  - lib/parka.rb
139
141
  - lib/parka/cli.rb
140
142
  - lib/parka/specification.rb
141
143
  - lib/rubygems_plugin.rb
144
+ - spec/parka/cli_spec.rb
145
+ - spec/parka/specification_spec.rb
146
+ - spec/parka_spec.rb
147
+ - spec/spec_helper.rb
142
148
  has_rdoc: true
143
149
  homepage: http://github.com/ddollar/parka
144
150
  licenses: []
@@ -169,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
175
  requirements: []
170
176
 
171
177
  rubyforge_project: nowarning
172
- rubygems_version: 1.3.7
178
+ rubygems_version: 1.5.0
173
179
  signing_key:
174
180
  specification_version: 3
175
181
  summary: Simple gem building using bundler