parka 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- metadata +60 -114
- data/README.md +0 -87
- data/data/example/lib/somegem.rb +0 -3
- data/data/example/somegem.gemspec +0 -12
- data/lib/parka.rb +0 -4
- data/lib/parka/cli.rb +0 -116
- data/lib/parka/specification.rb +0 -60
- data/lib/rubygems_plugin.rb +0 -0
- data/spec/parka/cli_spec.rb +0 -2
- data/spec/parka/specification_spec.rb +0 -28
- data/spec/parka_spec.rb +0 -8
- data/spec/spec_helper.rb +0 -6
metadata
CHANGED
@@ -1,150 +1,96 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: parka
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.6.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
-
|
9
|
-
David Dollar
|
10
|
-
|
7
|
+
authors:
|
8
|
+
- David Dollar
|
11
9
|
autorequire:
|
12
10
|
bindir: bin
|
13
11
|
cert_chain: []
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
name: rake
|
20
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
-
none: false
|
22
|
-
requirements:
|
23
|
-
- - ">="
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: "0"
|
26
|
-
type: :development
|
27
|
-
prerelease: false
|
28
|
-
version_requirements: *id001
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: rcov
|
31
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
32
|
-
none: false
|
33
|
-
requirements:
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: "0"
|
37
|
-
type: :development
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: *id002
|
40
|
-
- !ruby/object:Gem::Dependency
|
41
|
-
name: rr
|
42
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: "0"
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: *id003
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: rspec
|
53
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
12
|
+
date: 2011-09-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: crack
|
16
|
+
requirement: &70147311209960 !ruby/object:Gem::Requirement
|
54
17
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version:
|
59
|
-
type: :
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.3.0
|
22
|
+
type: :runtime
|
60
23
|
prerelease: false
|
61
|
-
version_requirements: *
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
64
|
-
requirement: &
|
24
|
+
version_requirements: *70147311209960
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: psych
|
27
|
+
requirement: &70147311208720 !ruby/object:Gem::Requirement
|
65
28
|
none: false
|
66
|
-
requirements:
|
67
|
-
- -
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version:
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.2.1
|
70
33
|
type: :runtime
|
71
34
|
prerelease: false
|
72
|
-
version_requirements: *
|
73
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *70147311208720
|
36
|
+
- !ruby/object:Gem::Dependency
|
74
37
|
name: rest-client
|
75
|
-
requirement: &
|
38
|
+
requirement: &70147311206640 !ruby/object:Gem::Requirement
|
76
39
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.6.7
|
81
44
|
type: :runtime
|
82
45
|
prerelease: false
|
83
|
-
version_requirements: *
|
84
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
version_requirements: *70147311206640
|
47
|
+
- !ruby/object:Gem::Dependency
|
85
48
|
name: thor
|
86
|
-
requirement: &
|
49
|
+
requirement: &70147311205180 !ruby/object:Gem::Requirement
|
87
50
|
none: false
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.14.6
|
92
55
|
type: :runtime
|
93
56
|
prerelease: false
|
94
|
-
version_requirements: *
|
95
|
-
description:
|
96
|
-
email:
|
97
|
-
|
98
|
-
|
99
|
-
executables:
|
57
|
+
version_requirements: *70147311205180
|
58
|
+
description:
|
59
|
+
email: ddollar@gmail.com
|
60
|
+
executables:
|
100
61
|
- parka
|
101
62
|
extensions: []
|
102
|
-
|
103
63
|
extra_rdoc_files: []
|
104
|
-
|
105
|
-
files:
|
64
|
+
files:
|
106
65
|
- bin/parka
|
107
|
-
- README.md
|
108
|
-
- data/example/lib/somegem.rb
|
109
|
-
- data/example/somegem.gemspec
|
110
|
-
- lib/parka.rb
|
111
|
-
- lib/parka/cli.rb
|
112
|
-
- lib/parka/specification.rb
|
113
|
-
- lib/rubygems_plugin.rb
|
114
|
-
- spec/parka/cli_spec.rb
|
115
|
-
- spec/parka/specification_spec.rb
|
116
|
-
- spec/parka_spec.rb
|
117
|
-
- spec/spec_helper.rb
|
118
|
-
has_rdoc: true
|
119
66
|
homepage: http://github.com/ddollar/parka
|
120
67
|
licenses: []
|
121
|
-
|
122
68
|
post_install_message:
|
123
69
|
rdoc_options: []
|
124
|
-
|
125
|
-
require_paths:
|
70
|
+
require_paths:
|
126
71
|
- lib
|
127
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
128
73
|
none: false
|
129
|
-
requirements:
|
130
|
-
- -
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
|
133
|
-
segments:
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
segments:
|
134
79
|
- 0
|
135
|
-
|
136
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
hash: 619310658013306837
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
82
|
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version:
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
hash: 619310658013306837
|
142
90
|
requirements: []
|
143
|
-
|
144
|
-
|
145
|
-
rubygems_version: 1.6.2
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 1.8.10
|
146
93
|
signing_key:
|
147
94
|
specification_version: 3
|
148
95
|
summary: Simple gem building using bundler
|
149
96
|
test_files: []
|
150
|
-
|
data/README.md
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# parka
|
2
|
-
|
3
|
-
## Installation
|
4
|
-
|
5
|
-
$ gem install parka
|
6
|
-
|
7
|
-
## Usage
|
8
|
-
|
9
|
-
Create a `projectname.gemspec` file in the root of your gem like this:
|
10
|
-
|
11
|
-
require "rubygems"
|
12
|
-
require "parka/specification"
|
13
|
-
|
14
|
-
Parka::Specification.new do |gem|
|
15
|
-
gem.name = "somegem"
|
16
|
-
gem.version = Somegem::VERSION
|
17
|
-
gem.summary = "A sample gem"
|
18
|
-
gem.homepage = "http://example.org"
|
19
|
-
end
|
20
|
-
|
21
|
-
Create a `Gemfile` to declare the dependencies of your gem:
|
22
|
-
|
23
|
-
source "http://rubygems.org"
|
24
|
-
|
25
|
-
gem "rest-client"
|
26
|
-
|
27
|
-
group :development do
|
28
|
-
gem "parka"
|
29
|
-
end
|
30
|
-
|
31
|
-
group :test do
|
32
|
-
gem "rake"
|
33
|
-
gem "rcov"
|
34
|
-
gem "rspec"
|
35
|
-
end
|
36
|
-
|
37
|
-
Gems in the `development` and `test` groups will become development
|
38
|
-
dependencies of your gem.
|
39
|
-
|
40
|
-
## Building Gems
|
41
|
-
|
42
|
-
The gem can be built by using `gem build projectname.gemspec`
|
43
|
-
|
44
|
-
## Using the parka command-line tool
|
45
|
-
|
46
|
-
### parka build
|
47
|
-
|
48
|
-
Build a .gem file.
|
49
|
-
|
50
|
-
$ parka build
|
51
|
-
Building somegem-0.1.gem
|
52
|
-
Successfully built RubyGem
|
53
|
-
Name: somegem
|
54
|
-
Version: 0.1
|
55
|
-
File: somegem-0.1.gem
|
56
|
-
|
57
|
-
### parka install
|
58
|
-
|
59
|
-
Build a .gem file and install it locally.
|
60
|
-
|
61
|
-
$ parka install
|
62
|
-
Building somegem-0.1.gem
|
63
|
-
Successfully built RubyGem
|
64
|
-
Name: somegem
|
65
|
-
Version: 0.1
|
66
|
-
File: somegem-0.1.gem
|
67
|
-
Successfully installed somegem-0.1.gem
|
68
|
-
|
69
|
-
### parka push
|
70
|
-
|
71
|
-
Build a .gem file and push it to Github and RubyGems.org. Will create the GitHub repo if necessary.
|
72
|
-
|
73
|
-
$ parka push
|
74
|
-
Building somegem-0.1.gem
|
75
|
-
Successfully built RubyGem
|
76
|
-
Name: somegem
|
77
|
-
Version: 0.1
|
78
|
-
File: somegem-0.1.gem
|
79
|
-
Delta compression using up to 8 threads.
|
80
|
-
Compressing objects: 100% (8/8), done.
|
81
|
-
Writing objects: 100% (9/9), 1.26 KiB, done.
|
82
|
-
Total 9 (delta 3), reused 0 (delta 0)
|
83
|
-
To git@github.com:ddollar/somegem.git
|
84
|
-
edffa40..249581c master -> master
|
85
|
-
* [new tag] v0.1 -> v0.1
|
86
|
-
Pushing gem to RubyGems.org...
|
87
|
-
Successfully registered gem: somegem (0.1)
|
data/data/example/lib/somegem.rb
DELETED
@@ -1,12 +0,0 @@
|
|
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
DELETED
data/lib/parka/cli.rb
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
require "crack"
|
2
|
-
require "rubygems/commands/push_command"
|
3
|
-
require "rubygems/dependency_installer"
|
4
|
-
require "parka"
|
5
|
-
require "rest_client"
|
6
|
-
require "thor"
|
7
|
-
|
8
|
-
class Parka::CLI < Thor
|
9
|
-
|
10
|
-
desc "build [GEMSPEC]", "Build the gem"
|
11
|
-
|
12
|
-
method_option :filename, :type => :string, :aliases => "-f",
|
13
|
-
:desc => "Build to the specified filename"
|
14
|
-
|
15
|
-
def build(gemspec_filename=nil)
|
16
|
-
gemspec = Gem::Specification.load(gemspec_filename || default_gemspec)
|
17
|
-
filename = options[:filename] || "pkg/#{gemspec.file_name}"
|
18
|
-
|
19
|
-
say "Building #{gemspec.file_name}"
|
20
|
-
|
21
|
-
FileUtils.mkdir_p File.dirname(filename)
|
22
|
-
Gem::Builder.new(gemspec).build
|
23
|
-
FileUtils.mv gemspec.file_name, filename
|
24
|
-
|
25
|
-
filename
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "install [GEMSPEC]", "Build and install the gem"
|
29
|
-
|
30
|
-
def install(gemspec_filename=nil)
|
31
|
-
original_home = ENV["GEM_HOME"]
|
32
|
-
gemfile = build(gemspec_filename)
|
33
|
-
ENV["GEM_HOME"] = original_home
|
34
|
-
|
35
|
-
system "gem install #{gemfile}"
|
36
|
-
end
|
37
|
-
|
38
|
-
desc "push [GEMSPEC]", "Build the gem and push it to GitHub and RubyGems.org"
|
39
|
-
|
40
|
-
method_option :create, :type => :boolean, :aliases => "-c",
|
41
|
-
:desc => "Create a Github repository for this project"
|
42
|
-
|
43
|
-
method_option :filename, :type => :string, :aliases => "-f",
|
44
|
-
:desc => "Build to the specified filename"
|
45
|
-
|
46
|
-
def push(gemspec_filename=nil)
|
47
|
-
gemspec = Gem::Specification.load(gemspec_filename || default_gemspec)
|
48
|
-
gemfile = options[:filename] || build(gemspec_filename)
|
49
|
-
|
50
|
-
# create github remote
|
51
|
-
remotes = %x{ git remote }.strip.split("\n")
|
52
|
-
unless remotes.include?("github")
|
53
|
-
%x{ git remote add github git@github.com:#{github_username}/#{gemspec.name}.git }
|
54
|
-
end
|
55
|
-
|
56
|
-
# create github repo
|
57
|
-
if options[:create]
|
58
|
-
begin
|
59
|
-
github["repos/create"].post(
|
60
|
-
:name => gemspec.name,
|
61
|
-
:description => gemspec.summary,
|
62
|
-
:homepage => gemspec.homepage,
|
63
|
-
:public => "1"
|
64
|
-
)
|
65
|
-
rescue
|
66
|
-
error "Unable to create GitHub repository: #{gemspec.name}"
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# create release tag
|
71
|
-
%x{ git tag v#{gemspec.version} }
|
72
|
-
|
73
|
-
# push to github
|
74
|
-
%x{ git push github master --tags }
|
75
|
-
|
76
|
-
# push to rubygems
|
77
|
-
pusher = Gem::Commands::PushCommand.new
|
78
|
-
pusher.send_gem gemfile
|
79
|
-
end
|
80
|
-
|
81
|
-
private ######################################################################
|
82
|
-
|
83
|
-
def chroot(dir)
|
84
|
-
FileUtils.mkdir_p dir
|
85
|
-
|
86
|
-
Dir.chdir(dir) { yield }
|
87
|
-
end
|
88
|
-
|
89
|
-
def default_gemspec
|
90
|
-
"#{File.basename(Dir.pwd)}.gemspec"
|
91
|
-
end
|
92
|
-
|
93
|
-
def error(message)
|
94
|
-
puts "ERROR: #{message}"
|
95
|
-
exit 1
|
96
|
-
end
|
97
|
-
|
98
|
-
def github
|
99
|
-
username = github_username + "/token"
|
100
|
-
password = github_token
|
101
|
-
RestClient::Resource.new("http://github.com/api/v2/json", username, password)
|
102
|
-
end
|
103
|
-
|
104
|
-
def github_username
|
105
|
-
%x{ git config github.user }.strip
|
106
|
-
end
|
107
|
-
|
108
|
-
def github_token
|
109
|
-
%x{ git config github.token }.strip
|
110
|
-
end
|
111
|
-
|
112
|
-
def github_repositories
|
113
|
-
Crack::JSON.parse(github["repos/show/#{github_username}"].get)["repositories"]
|
114
|
-
end
|
115
|
-
|
116
|
-
end
|
data/lib/parka/specification.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
require "bundler"
|
2
|
-
require "parka"
|
3
|
-
require "rubygems"
|
4
|
-
|
5
|
-
class Parka::Specification < Gem::Specification
|
6
|
-
|
7
|
-
def self.new(&block)
|
8
|
-
gemspec_filename = caller.first.split(':').first
|
9
|
-
|
10
|
-
# add the lib/ dir of the gem to the load path
|
11
|
-
$:.unshift File.expand_path(File.join(File.dirname(gemspec_filename), 'lib'))
|
12
|
-
|
13
|
-
# autorequire the same name as the gem spec
|
14
|
-
require File.basename(gemspec_filename, File.extname(gemspec_filename))
|
15
|
-
|
16
|
-
spec = Gem::Specification.new(&block)
|
17
|
-
|
18
|
-
# set up some sensible defaults
|
19
|
-
spec.author ||= default_author
|
20
|
-
spec.email ||= default_email
|
21
|
-
spec.description ||= spec.summary
|
22
|
-
|
23
|
-
# hack to avoid rubyforge_project warning
|
24
|
-
spec.rubyforge_project = "nowarning"
|
25
|
-
|
26
|
-
# default file list if none specified
|
27
|
-
spec.files = (spec.files + default_files).uniq
|
28
|
-
|
29
|
-
# get dependencies from bundler
|
30
|
-
add_bundler_dependencies(spec)
|
31
|
-
|
32
|
-
spec
|
33
|
-
end
|
34
|
-
|
35
|
-
private ######################################################################
|
36
|
-
|
37
|
-
def self.default_author
|
38
|
-
%x{ git config user.name }
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.default_email
|
42
|
-
%x{ git config user.email }
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.default_files
|
46
|
-
%x{ git ls-files }.split("\n").select { |f| f.match(%r{^(README|bin/|data/|ext/|lib/|spec/|test/)}) }
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.add_bundler_dependencies(spec)
|
50
|
-
groups = Bundler.definition.groups - [:development, :test]
|
51
|
-
deps = Bundler.definition.dependencies
|
52
|
-
|
53
|
-
runtime = deps.select { |d| (d.groups & groups).any? }
|
54
|
-
development = deps - runtime
|
55
|
-
|
56
|
-
development.each { |d| spec.add_development_dependency(d.name, *d.requirement.as_list) }
|
57
|
-
runtime.each { |d| spec.add_dependency(d.name, *d.requirement.as_list) }
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
data/lib/rubygems_plugin.rb
DELETED
File without changes
|
data/spec/parka/cli_spec.rb
DELETED
@@ -1,28 +0,0 @@
|
|
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
|
data/spec/parka_spec.rb
DELETED