boson 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.3.3
2
+ * Fix install command for https (#22)
3
+
1
4
  == 0.3.2
2
5
  * Add commandline backtrace option (#18)
3
6
 
data/README.rdoc CHANGED
@@ -101,7 +101,7 @@ Having done that, let's start up irb:
101
101
  2 rows in set
102
102
 
103
103
  # Let's install another library
104
- bash> boson install http://github.com/cldwalker/irbfiles/raw/master/boson/commands/public/irb_core.rb
104
+ bash> boson install https://github.com/cldwalker/irbfiles/raw/master/boson/commands/public/irb_core.rb
105
105
  Saved to /Users/bozo/.boson/commands/irb_core.rb
106
106
 
107
107
  # Let's start irb ...
@@ -28,7 +28,7 @@ module Boson::Commands::WebCore
28
28
  end
29
29
  end
30
30
 
31
- def_which_requires(:get, 'uri', 'net/http') do |*args|
31
+ def_which_requires(:get, 'net/https') do |*args|
32
32
  url, options = args[0], args[1] || {}
33
33
  url = build_url(url, options[:params]) if options[:params]
34
34
  Get.new(url).request(options)
@@ -112,12 +112,19 @@ module Boson::Commands::WebCore
112
112
  # Returns body string if successful or nil if not.
113
113
  def get_body
114
114
  uri = URI.parse(@url)
115
- @response = Net::HTTP.get_response uri
115
+ @response = get_response(uri)
116
116
  (@options[:any_response] || @response.code == '200') ? @response.body : nil
117
117
  rescue
118
118
  @options[:raise_error] ? raise : puts("Error: GET '#{@url}' -> #{$!.class}: #{$!.message}")
119
119
  end
120
120
 
121
+ def get_response(uri)
122
+ net = Net::HTTP.new(uri.host, uri.port)
123
+ net.verify_mode = OpenSSL::SSL::VERIFY_NONE if uri.scheme == 'https'
124
+ net.use_ssl = true if uri.scheme == 'https'
125
+ net.start {|http| http.request_get(uri.request_uri) }
126
+ end
127
+
121
128
  # Returns nil if dependencies or parsing fails
122
129
  def parse_body(body)
123
130
  format = determine_format(@options[:parse])
@@ -8,7 +8,9 @@ module Boson
8
8
  # it will load up all detected libraries. Options:
9
9
  # [:libraries] Array of libraries to load.
10
10
  # [:verbose] Boolean to be verbose about libraries loading. Default is true.
11
- # [:no_defaults] Boolean which turns off loading any default libraries. Default is false.
11
+ # [:no_defaults] Boolean or :all which turns off loading default libraries. If set to true,
12
+ # effects loading user's console default libraries. If set to :all, effects
13
+ # all libraries including boson's. Default is false.
12
14
  # [:autoload_libraries] Boolean which makes any command execution easier. It redefines
13
15
  # method_missing on Boson.main_object so that commands with unloaded
14
16
  # libraries are automatically loaded. Default is false.
@@ -44,16 +46,13 @@ module Boson
44
46
  end
45
47
 
46
48
  def default_libraries #:nodoc:
47
- defaults = super
48
- unless @options[:no_defaults]
49
- new_defaults = Boson.repos.map {|e| e.config[:console_defaults] }.flatten
50
- new_defaults = detected_libraries if new_defaults.empty?
51
- defaults += new_defaults
52
- defaults.uniq!
53
- end
54
- defaults
49
+ return [] if @options[:no_defaults] == :all
50
+ return super if @options[:no_defaults]
51
+ defaults = super + Boson.repos.map {|e| e.config[:console_defaults] }.flatten
52
+ defaults += detected_libraries if defaults.empty?
53
+ defaults.uniq
55
54
  end
56
55
  end
57
56
  end
58
57
  end
59
-
58
+
data/lib/boson/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Boson
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boson
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gabriel Horner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-09 00:00:00 -05:00
18
+ date: 2011-02-07 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency