specific_install 0.2.13 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1b4150e9945dfd11ae1805180cfb553882fc4b07
4
- data.tar.gz: 05184004d0b88f47e6a5048874f38c76cd6aac99
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjE1Y2JmOWUwZDk1ODRiNTAyOTYxZjFkNzVlOGYzMGQwODVjMDliYQ==
5
+ data.tar.gz: !binary |-
6
+ OTdiYjdiNGY3NjlhNTVkZDhlODIxZGViZjBhMTc4ZTFiMmJkOTAwYg==
5
7
  SHA512:
6
- metadata.gz: ff5498b13499b77a2e9835568fa9a2c332f599c2c9f4c4b8e0cf4ef27192477bcb5bbd207293502eb65f04f2f65a7eb209a30a83cbad5daba0d99c3692fd3e0f
7
- data.tar.gz: 15e3c433ecb0d6913cb6195278430a5bdcad080cc4cbb786ba342244deead241b459e5d9da7d535557cb4051cdbaa643b30fb792aa1d4477bc6f3acb4d4270d8
8
+ metadata.gz: !binary |-
9
+ MzUyMmU3OWUzZDIwMjc2YzlkNTAxZDUwYmYxNDAzNzc0YzU4NmEyODY2ZjZm
10
+ MTU4OTkzNTFmYjJhMzhmMTY2OTUzYzAwZDM0NmM0OWJlZWQ4OWMwMjRmOWEy
11
+ ZmE5MjgxZjY1OWU2ZmJkMTYwZmFlOTI0MDZjOWZiYzBhZjAwYTc=
12
+ data.tar.gz: !binary |-
13
+ NTNkMjA1OWMxMzE4ZjEzYjgzZjkzZTJhZjQ3N2YzMzNmOTkwNWRjNjYzYTFl
14
+ MTBkMTc0MDQyNjgzMzY0YmIyOGNhMzczY2ZkNjVjMDI3ZjM1Mjc3ZTE2ZDU5
15
+ MWNhOWYyMDA3NTM3MzM0YmRmMmNjOGVhNmQzMGI4ZmE5MDk2MDA=
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- specific_install (0.2.8)
4
+ specific_install (0.3.0)
5
5
  backports
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- backports (3.3.4)
10
+ backports (3.6.0)
11
11
  diff-lcs (1.2.4)
12
12
  multi_json (1.8.0)
13
13
  os (0.9.6)
@@ -39,3 +39,6 @@ DEPENDENCIES
39
39
  simplecov
40
40
  simplecov-vim
41
41
  specific_install!
42
+
43
+ BUNDLED WITH
44
+ 1.10.6
data/README.md CHANGED
@@ -47,6 +47,12 @@ Or a specific branch in an explicit way
47
47
  $ gem specific_install -l http://github.com/githubsvnclone/rdoc.git -b edge
48
48
  `
49
49
 
50
+ Or a specific subdirectory in a repo
51
+
52
+ `
53
+ $ gem specific_install https://github.com/orlandohill/waxeye -d src/ruby
54
+ `
55
+
50
56
  The following URI types are accepted:
51
57
 
52
58
  - http(s)://github.com/rdp/specific_install.git
@@ -71,6 +77,9 @@ The following URI types are accepted:
71
77
  `git specific_install -l rdp/specific_install -b pre-release`
72
78
  Note: This feature is new and may not fail gracefully.
73
79
 
80
+ -d --directory DIRECTORY in source
81
+ This will change the directory in the downloaded source directory
82
+ before building the gem.
74
83
 
75
84
  `git_install` is aliased to the behavior of `specific_install`
76
85
  This alias is shorter and is more intention revealing of the gem's behavior.
@@ -24,11 +24,15 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
24
24
  options[:branch] = branch
25
25
  end
26
26
 
27
+ add_option('-d', '--directory DIRECTORY', arguments) do |directory, options|
28
+ options[:directory] = directory
29
+ end
27
30
  end
28
31
 
29
32
  def arguments
30
33
  "LOCATION like http://github.com/rdp/ruby_tutorials_core or git://github.com/rdp/ruby_tutorials_core.git or http://host/gem_name.gem\n" +
31
- "BRANCH (optional) like beta, or new-feature"
34
+ "BRANCH (optional) like beta, or new-feature\n" +
35
+ "DIRECTORY (optional) This will change the directory in the downloaded source directory before building the gem."
32
36
  end
33
37
 
34
38
  def usage
@@ -42,7 +46,13 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
42
46
  raise ArgumentError, "No location received. Use like `gem specific_install -l http://example.com/rdp/specific_install`"
43
47
  end
44
48
  Dir.mktmpdir do |dir|
45
- @dir = dir
49
+ if subdir = options[:directory]
50
+ abort("Subdir '#{subdir}' is not a valid directory") unless valid_subdir?(subdir)
51
+ @top_dir = dir
52
+ @src_dir = File.join(dir, subdir)
53
+ else
54
+ @top_dir = @src_dir = dir
55
+ end
46
56
  determine_source_and_install
47
57
  end
48
58
  end
@@ -73,7 +83,7 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
73
83
  end
74
84
 
75
85
  def install_gem
76
- Dir.chdir @dir do
86
+ Dir.chdir @top_dir do
77
87
  output.puts "downloading #{@loc}"
78
88
  download(@loc, gem_name)
79
89
 
@@ -91,8 +101,8 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
91
101
  @loc = [@loc, '.git'].join unless @loc[/\.git$/]
92
102
 
93
103
  redirect_for_specs = ENV.fetch( "SPECIFIC_INSTALL_SPEC" ) { "" }
94
- system("git clone #{@loc} #{@dir} #{redirect_for_specs}")
95
- install_from_git(@dir)
104
+ system("git clone #{@loc} #{@top_dir} #{redirect_for_specs}")
105
+ install_from_git(@src_dir)
96
106
  end
97
107
 
98
108
  def gem_name
@@ -103,16 +113,16 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
103
113
  output.puts 'git installing from ' + @loc
104
114
 
105
115
  redirect_for_specs = ENV.fetch( "SPECIFIC_INSTALL_SPEC" ) { "" }
106
- system("git clone #{@loc} #{@dir} #{redirect_for_specs}")
107
- install_from_git(@dir)
116
+ system("git clone #{@loc} #{@top_dir} #{redirect_for_specs}")
117
+ install_from_git(@src_dir)
108
118
  end
109
119
 
110
120
  def install_shorthand
111
121
  output.puts "Installing from git@github.com:#{@loc}.git"
112
122
 
113
123
  redirect_for_specs = ENV.fetch( "SPECIFIC_INSTALL_SPEC" ) { "" }
114
- system("git clone git@github.com:#{@loc}.git #{@dir} #{redirect_for_specs}")
115
- install_from_git(@dir)
124
+ system("git clone git@github.com:#{@loc}.git #{@top_dir} #{redirect_for_specs}")
125
+ install_from_git(@src_dir)
116
126
  end
117
127
 
118
128
  def download( full_url, output_name )
@@ -124,8 +134,10 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
124
134
 
125
135
  def install_from_git(dir)
126
136
  Dir.chdir dir do
127
- change_to_branch(@branch) if @branch
128
- system("git submodule update --init --recursive") # issue 25
137
+ Dir.chdir @top_dir do
138
+ change_to_branch(@branch) if @branch
139
+ system("git submodule update --init --recursive") # issue 25
140
+ end
129
141
  # reliable method
130
142
  if install_gemspec
131
143
  success_message
@@ -201,6 +213,15 @@ class Gem::Commands::SpecificInstallCommand < Gem::Command
201
213
  system("git checkout #{branch}")
202
214
  system("git branch")
203
215
  end
216
+
217
+ DOTDOT_REGEX = /(?:#{File::PATH_SEPARATOR}|\A)\.\.(?:#{File::PATH_SEPARATOR}|\z)/.freeze
218
+ ABS_REGEX = /\A#{File::PATH_SEPARATOR}/.freeze
219
+
220
+ def valid_subdir?(subdir)
221
+ !subdir.empty? &&
222
+ subdir !~ DOTDOT_REGEX &&
223
+ subdir !~ ABS_REGEX
224
+ end
204
225
  end
205
226
 
206
227
  class Gem::Commands::GitInstallCommand < Gem::Commands::SpecificInstallCommand
@@ -1,3 +1,3 @@
1
1
  module SpecificInstall
2
- VERSION = "0.2.13"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -39,7 +39,7 @@ describe Gem::Commands::SpecificInstallCommand do
39
39
  dir
40
40
  end
41
41
  end
42
- subject.instance_variable_set(:@dir, "foo")
42
+ subject.instance_variable_set(:@top_dir, "foo")
43
43
  end
44
44
  describe "#install_git" do
45
45
  before do
@@ -218,4 +218,4 @@ describe "Integration Tests" do
218
218
  expect(stdout).to match(/Successfully installed/)
219
219
  end
220
220
  end
221
- end
221
+ end if ENV['SPECIFIC_INSTALL_INTEGRATION_SPECS']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specific_install
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Pack
@@ -9,104 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-21 00:00:00.000000000 Z
12
+ date: 2015-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: backports
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - ! '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - ! '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: sane
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - ! '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - ! '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: bundler
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ~>
61
61
  - !ruby/object:Gem::Version
62
62
  version: '1.3'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '1.3'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rake
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
74
+ - - ! '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - ! '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: simplecov
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - ! '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - ! '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: simplecov-vim
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - ! '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - ! '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  description: rubygems plugin that allows you you to install a gem from from its github
@@ -118,7 +118,7 @@ executables: []
118
118
  extensions: []
119
119
  extra_rdoc_files: []
120
120
  files:
121
- - ".gitignore"
121
+ - .gitignore
122
122
  - ChangeLog
123
123
  - Gemfile
124
124
  - Gemfile.lock
@@ -142,17 +142,17 @@ require_paths:
142
142
  - lib
143
143
  required_ruby_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">="
145
+ - - ! '>='
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []
154
- rubyforge_project: "[none]"
155
- rubygems_version: 2.2.2
154
+ rubyforge_project: ! '[none]'
155
+ rubygems_version: 2.4.2
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: rubygems plugin that allows you you to install a gem from from its github
@@ -160,4 +160,3 @@ summary: rubygems plugin that allows you you to install a gem from from its gith
160
160
  test_files:
161
161
  - spec/spec_helper.rb
162
162
  - spec/specific_install_spec.rb
163
- has_rdoc: