specific_install 0.2.5 → 0.2.7

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmJlZWEyZmM1NzgxZWNjMGU1MjcxOWE4YjBjZDM1NmViZjRkYjA4ZQ==
4
+ NTg5NmQ2ZTU3YTY5ZTYwYjE1ZjdjZTVlMjI2MmRiNzljMjMzOGZlNA==
5
5
  data.tar.gz: !binary |-
6
- MTA4NTFlNjE1Y2QxNjQyMzMyNTEzNjZhODJhNTU4ZmFmOTExM2Q0Yw==
6
+ MDBiNDM4MmEyZTljMTljMWRiMjYwYmMwZTA4MjhlOTI1ZmRkZTRjYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjczMTc2MzM0YjJiNzhmNWQwZGI2YTBjN2FmOTU1YThmZTM0ZjE5ODE4NGQ4
10
- YmYxNzAxNWQyNTdkYjkyYzU2NGY3MWVlOGNjMmY5MTYyNWU2ZjI5MTk5MTAy
11
- ZTNjM2Y1ZGE4NzQxNzhkYjE0NTc1MDJmMmU1ODA4MTMzYTg3ODk=
9
+ MjlmNjFjZWY1YmIyYTMyZTcxN2ZiNDg1OWFiYTBhMTI2MDA1NDlmNzhlY2Ew
10
+ MzljM2JmNjRiZTQwMWExZDAyMmFiN2YxYWE1MmQ0MGVjNjg3NDY2NTAxMjJh
11
+ ZjM1M2JmNmNiMzFkYzViYjFkNDAyNzA2OWM2ZDI3YTQ0NDAxODY=
12
12
  data.tar.gz: !binary |-
13
- NGQxNTkxZWExZmRmZGUxMzc3YTllOTJkNjZmNjM4ZWExYjkyYTk4YzdmMGE5
14
- MTY2MTI4MDBkN2I3NzQ4Zjk0YzQwMzQ3YjJiMzcxMGQ2ZjY4YWFlNTAyMDgx
15
- NTk2OWU1MDY1YjM5NDBlN2VlZjg5YjY1ZTRkN2VmNTgwNDQ3OWU=
13
+ NGNjOTliMWNhNWVkNjJiNDY2MjZmNjBhZWFjMWIzNzIxM2RiZDhlYzkyMWM5
14
+ ZTA4MmNlZWE4YzJmYWJhNmI4ZTYxY2MxYzM2OTQ1YzQ3NGQ0NjZkYmMxNzI1
15
+ NmFmZTNmMjE4MTQxYmY4NGQzMTZhNDAyNGYyZjRhM2M1MTE4YTg=
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .config
2
+ InstalledFiles
3
+ pkg
4
+ *.gem
5
+ .bundle
6
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in specific_install.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2010-2013 Roger Pack
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # Gem::SpecificInstall
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ gem 'specific_install'
8
+
9
+ And then execute:
10
+
11
+ $ bundle
12
+
13
+ Or install it yourself as:
14
+
15
+ $ gem install specific_install
16
+
17
+ ## Usage
18
+
19
+ A Rubygem plugin that allows you to install an "edge" gem straight from its github repository,
20
+ or install one from an arbitrary url web:
21
+
22
+ ex:
23
+
24
+ `
25
+ $ gem specific_install -l http://github.com/githubsvnclone/rdoc.git
26
+ `
27
+
28
+ ### Additional Options
29
+
30
+ -l --location URL of resource
31
+ Formats of URL/Resource
32
+ * Full URL to HTTP Repo `https://github.com/rdp/specific_install.git`
33
+ * Full URL to Git Repo `git@github.com:rdp/specific_install.git`
34
+ * URL of Pre-Built Gem `http://example.com/specific_install.gem`
35
+ * Github Repo shortcode `rdp/specific_install`
36
+
37
+ -b --branch BRANCH to use for Gem creation
38
+ Branch option does a `git checkout BRANCH` before `gem build GEM`
39
+ Example:
40
+ `git specific_install -l rdp/specific_install -b pre-release`
41
+ Note: This feature is new and may not fail gracefully.
42
+
43
+
44
+ `git_install` is aliased to the behavior of `specific_install`
45
+ This alias is shorter and is more intention revealing of the gem's behavior.
46
+ ## Internal Behavior
47
+
48
+ It runs `git clone`, and `rake install,` install the gem, then deletes the temp directory]
49
+
50
+
51
+ ## Contributing
52
+
53
+ 1. Fork it
54
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
55
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
56
+ 4. Push to the branch (`git push origin my-new-feature`)
57
+ 5. Create new Pull Request
58
+
59
+ Enjoy!
60
+
61
+ Copyright 2010-2013 Roger Pack - `http://github.com/rdp/specific_installs`
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,133 @@
1
+ require 'rubygems/command_manager'
2
+ require 'rubygems/dependency_installer'
3
+ require 'rubygems/builder'
4
+ require 'tempfile'
5
+ require 'backports'
6
+ require 'fileutils'
7
+ require 'open-uri'
8
+
9
+ class Gem::Commands::SpecificInstallCommand < Gem::Command
10
+
11
+ def description
12
+ "Allows you to install an 'edge' gem straight from its github repository or from a web site"
13
+ end
14
+
15
+ def initialize
16
+ super 'specific_install', description
17
+
18
+ add_option('-l', '--location LOCATION', arguments) do |location|
19
+ options[:location] = location
20
+ end
21
+
22
+ add_option('-b', '--branch LOCATION', arguments) do |branch|
23
+ options[:branch] = branch
24
+ end
25
+
26
+ end
27
+
28
+ def arguments
29
+ "LOCATION like http://github.com/rdp/ruby_tutorials_core or git://github.com/rdp/ruby_tutorials_core.git or http://host/gem_name.gem"
30
+ "BRANCH (optional) like beta, or new-feature"
31
+ end
32
+
33
+ def usage
34
+ "#{program_name} [LOCATION] [BRANCH]"
35
+ end
36
+
37
+ def execute
38
+ unless options[:location]
39
+ puts "No location received. Use `gem specific_install -l http://example.com/rdp/specific_install`"
40
+ exit 1
41
+ end
42
+ # options are
43
+ # http://github.com/githubsvnclone/rdoc.git
44
+ # git://github.com/githubsvnclone/rdoc.git
45
+ # git@github.com:rdp/install_from_git.git
46
+ # http://github.com/rdp/install_from_git [later]
47
+ # http://host/gem_name.gem
48
+ # rdp/specific_install
49
+ dir = Dir.mktmpdir
50
+ begin
51
+ loc = options[:location]
52
+ case loc
53
+ when /^http(.*)\.gem$/
54
+ Dir.chdir dir do
55
+ say "downloading #{loc}"
56
+ gem_name = loc.split("/").last
57
+ download(loc, gem_name)
58
+
59
+ if install_gemspec
60
+ success_message
61
+ else
62
+ puts "failed"
63
+ end
64
+ end
65
+ when /\.git$/
66
+ say 'git installing from ' + loc
67
+
68
+ system("git clone #{loc} #{dir}")
69
+ install_from_git(dir)
70
+ when %r(.*/.*)
71
+ puts "Installing from git@github.com:#{loc}.git"
72
+
73
+ system("git clone git@github.com:#{loc}.git #{dir}")
74
+ install_from_git(dir)
75
+ else
76
+ puts 'Error: must end with .git to be a git repository' +
77
+ 'or be in shorthand form: rdp/specific_install'
78
+ end
79
+ ensure
80
+ FileUtils.rm_rf dir
81
+ end
82
+
83
+ end
84
+
85
+ private
86
+
87
+ def download( full_url, output_name )
88
+ File.open(output_name, "wb") do |output_file|
89
+ output_file.write(open(full_url).read)
90
+ end
91
+ end
92
+
93
+ def install_from_git(dir)
94
+ Dir.chdir dir do
95
+ change_to_branch(options[:branch]) if options[:branch]
96
+ ['', 'rake gemspec', 'rake gem', 'rake build', 'rake package'].each do |command|
97
+ system command
98
+ if install_gemspec
99
+ success_message
100
+ exit 0
101
+ end
102
+ end
103
+ end
104
+ end
105
+
106
+ def success_message
107
+ puts 'Successfully installed'
108
+ end
109
+
110
+ def install_gemspec
111
+ if gemspec_file = Dir['*.gemspec'][0]
112
+ gemspec = Gem::Specification.load(gemspec_file)
113
+ gem = Gem::Builder.new(gemspec).build
114
+ elsif gem = Dir['**/*.gem'][0]
115
+ else
116
+ false
117
+ end
118
+
119
+ inst = Gem::DependencyInstaller.new
120
+ inst.install gem
121
+ end
122
+
123
+ def change_to_branch(branch)
124
+ system("git checkout #{branch}")
125
+ system("git branch")
126
+ end
127
+ end
128
+
129
+ class Gem::Commands::GitInstallCommand < Gem::Commands::SpecificInstallCommand
130
+ end
131
+
132
+ Gem::CommandManager.instance.register_command :specific_install
133
+ Gem::CommandManager.instance.register_command :git_install
@@ -0,0 +1,2 @@
1
+ require "specific_install/version"
2
+ require "rubygems/commands/specific_install_command"
@@ -0,0 +1,3 @@
1
+ module SpecificInstall
2
+ VERSION = "0.2.7"
3
+ end
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ $:.unshift File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ require 'specific_install/version'
5
+
6
+ Gem::Specification.new do |s|
7
+
8
+ s.name = "specific_install"
9
+ s.version = SpecificInstall::VERSION
10
+ s.description = %q{rubygems plugin that allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL}
11
+ s.summary = "rubygems plugin that allows you you to install a gem from from its github repository (like 'edge'), or from an arbitrary URL"
12
+ s.authors = ["Roger Pack"]
13
+ s.email = "rogerdpack@gmail.com"
14
+ s.homepage = "https://github.com/rdp/specific_install"
15
+ s.license = "MIT"
16
+
17
+ s.files = `git ls-files`.split($/)
18
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
+ s.require_paths = ["lib"]
21
+ s.platform = Gem::Platform::RUBY
22
+ s.rubyforge_project = '[none]'
23
+
24
+ s.add_dependency 'backports'
25
+ s.add_development_dependency 'rspec'
26
+ s.add_development_dependency 'sane'
27
+ s.add_development_dependency "bundler", "~> 1.3"
28
+ s.add_development_dependency "rake"
29
+ end
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.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Pack
@@ -86,7 +86,16 @@ email: rogerdpack@gmail.com
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
- files: []
89
+ files:
90
+ - .gitignore
91
+ - Gemfile
92
+ - LICENSE.txt
93
+ - README.md
94
+ - Rakefile
95
+ - lib/rubygems/commands/specific_install_command.rb
96
+ - lib/rubygems_plugin.rb
97
+ - lib/specific_install/version.rb
98
+ - specific_install.gemspec
90
99
  homepage: https://github.com/rdp/specific_install
91
100
  licenses:
92
101
  - MIT
@@ -106,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
115
  - !ruby/object:Gem::Version
107
116
  version: '0'
108
117
  requirements: []
109
- rubyforge_project:
118
+ rubyforge_project: ! '[none]'
110
119
  rubygems_version: 2.1.1
111
120
  signing_key:
112
121
  specification_version: 4