push_safety 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6b19907898a188b372ff708667f295fb31d04c6d
4
+ data.tar.gz: a23b94c4dce1c8441569dcddb19ccbd5d7fc4a93
5
+ SHA512:
6
+ metadata.gz: f93638173bf9fcd8751b5f53df159a5e64ab240e60833110f363e7f510e999c910bcb1e41ec54671d1680aaef62e1b6d0694dff0e336005cb36cbc498ef58113
7
+ data.tar.gz: 1914ad536be7e9207955b5dd46d6e349abdd3e80395d5f96e0303f31f6c8b331d2235e85a93379f8966bf015fb4d3a6cd78d431d04bc9dec0a9055b47118dec5
data/README.rdoc CHANGED
@@ -26,28 +26,32 @@ you have installed PushSafety.
26
26
 
27
27
  You must have ruby and rubygems installed.
28
28
 
29
- PushSafety has been tested on:
30
- * x86-linux (Ubuntu 10.10) with Ruby 1.8.7p299 and rubygems 1.3.7
31
- * x86-linux (rvm) with Ruby 1.9.2p0 (2010-08-18 revision 29036) and rubygems
32
- 1.3.7
29
+ PushSafety has been tested on x86-linux (debian squeeze) with:
30
+ * ruby-1.8.7-p358 and rubygems 1.8.17
31
+ * ruby-1.9.3-p125 and rubygems 1.8.17
32
+ * ruby-2.0.0-p0 and rubygems 2.0.3
33
33
 
34
34
  PushSafety has not yet been tested on Windows.
35
35
 
36
36
  == INSTALLATION
37
37
 
38
- sudo gem install push_safety
38
+ gem install push_safety
39
39
 
40
40
  == DEVELOPMENT
41
41
 
42
42
  To get the source and development depencies:
43
43
  git clone git://github.com/jdleesmiller/push_safety.git
44
44
  cd push_safety
45
- gem build push_safety.gemspec
46
- sudo gem install push_safety-X.X.X.gem --development
47
- where X.X.X is the current version.
45
+ bundle
46
+
47
+ To run the tests:
48
+ rake
48
49
 
49
50
  == HISTORY
50
51
 
52
+ <em>0.0.2</em> -- 2013-04-02
53
+ * fix for compatibility with ruby 2.0.0; tested on 1.8.7, 1.9.3 and 2.0.0
54
+
51
55
  <em>0.0.1</em>
52
56
  * first release
53
57
 
@@ -55,7 +59,7 @@ where X.X.X is the current version.
55
59
 
56
60
  (The MIT License)
57
61
 
58
- Copyright (c) 2010 John Lees-Miller
62
+ Copyright (c) 2013 John Lees-Miller
59
63
 
60
64
  Permission is hereby granted, free of charge, to any person obtaining
61
65
  a copy of this software and associated documentation files (the
@@ -1,3 +1,3 @@
1
1
  module PushSafety
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -1,6 +1,5 @@
1
1
  require 'rubygems/command_manager'
2
2
  require 'rubygems/commands/push_command'
3
- require 'rubygems/format'
4
3
 
5
4
  #
6
5
  # Patch the PushCommand to first check the whitelist.
@@ -11,7 +10,7 @@ require 'rubygems/format'
11
10
  class Gem::Commands::PushCommand
12
11
  # If this gets loaded twice, it will do strange things.
13
12
  if respond_to?(:unsafe_execute)
14
- raise "PushSafety has been loaded twice; something is wrong."
13
+ raise "PushSafety has been loaded twice; please check for old versions."
15
14
  end
16
15
 
17
16
  alias unsafe_description description
@@ -48,7 +47,8 @@ class Gem::Commands::PushCommand
48
47
  end
49
48
 
50
49
  grey_list = get_all_gem_names.map {|gem_file|
51
- Gem::Format.from_file_by_path(gem_file).spec.name}
50
+ get_gem_name_from_gem_file(gem_file)
51
+ }
52
52
  black_list = grey_list - white_list
53
53
 
54
54
  unless black_list.empty?
@@ -58,5 +58,22 @@ class Gem::Commands::PushCommand
58
58
 
59
59
  unsafe_execute
60
60
  end
61
+
62
+ protected
63
+
64
+ def get_gem_name_from_gem_file gem_file
65
+ # compatibility issue: before ruby 2.0.0, we used Gem::Format to parse the
66
+ # gem file to find its name, but Gem::Format has gone away, and the
67
+ # functionality we need has moved to Gem::Package. Gem::Package was a
68
+ # module in 1.9.3 and 1.8.7, so it did not respond to new, but in 2.0.0 it
69
+ # does, so we test that
70
+ require 'rubygems/package'
71
+ if Gem::Package.respond_to?(:new)
72
+ Gem::Package.new(gem_file).spec.name
73
+ else
74
+ require 'rubygems/format'
75
+ Gem::Format.from_file_by_path(gem_file).spec.name
76
+ end
77
+ end
61
78
  end
62
79
 
metadata CHANGED
@@ -1,101 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: push_safety
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - John Lees-Miller
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2010-12-06 00:00:00 +00:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2013-04-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: gemma
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 23
30
- segments:
31
- - 1
32
- - 0
33
- - 0
34
- version: 1.0.0
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
35
17
  - - ~>
36
- - !ruby/object:Gem::Version
37
- hash: 15
38
- segments:
39
- - 1
40
- - 0
41
- version: "1.0"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
42
20
  type: :development
43
- version_requirements: *id001
44
- description: |
45
- The gem push command makes it incredibly easy to publish your gems... maybe a
46
- little too easy. PushSafety is a RubyGems plugin that refuses to push a gem
47
- unless it is on a whitelist. Add your open source gems to your whitelist, and
48
- keep your private gems safe from accidental pushes.
49
-
50
- email:
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
27
+ description: "The gem push command makes it incredibly easy to publish your gems...
28
+ maybe a\nlittle too easy. PushSafety is a RubyGems plugin that refuses to push a
29
+ gem\nunless it is on a whitelist. Add your open source gems to your whitelist, and
30
+ \nkeep your private gems safe from accidental pushes.\n"
31
+ email:
51
32
  - jdleesmiller@gmail.com
52
33
  executables: []
53
-
54
34
  extensions: []
55
-
56
- extra_rdoc_files:
35
+ extra_rdoc_files:
57
36
  - README.rdoc
58
- files:
37
+ files:
38
+ - lib/rubygems_plugin.rb
59
39
  - lib/push_safety/version.rb
60
40
  - lib/push_safety.rb
61
- - lib/rubygems_plugin.rb
62
41
  - README.rdoc
63
- has_rdoc: true
64
42
  homepage: https://github.com/jdleesmiller/push_safety
65
- licenses: []
66
-
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
67
46
  post_install_message:
68
- rdoc_options:
47
+ rdoc_options:
69
48
  - --main
70
49
  - README.rdoc
71
50
  - --title
72
- - push_safety-0.0.1 Documentation
73
- require_paths:
51
+ - push_safety-0.0.2 Documentation
52
+ require_paths:
74
53
  - lib
75
- required_ruby_version: !ruby/object:Gem::Requirement
76
- none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- hash: 3
81
- segments:
82
- - 0
83
- version: "0"
84
- required_rubygems_version: !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- hash: 3
90
- segments:
91
- - 0
92
- version: "0"
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
93
64
  requirements: []
94
-
95
65
  rubyforge_project:
96
- rubygems_version: 1.3.7
66
+ rubygems_version: 2.0.3
97
67
  signing_key:
98
- specification_version: 3
68
+ specification_version: 4
99
69
  summary: Avoid accidentally pushing a private gem to rubygems.org (reduce paranoia).
100
70
  test_files: []
101
-
71
+ has_rdoc: