lib/gemline.rb in gemline-0.4.4 vs lib/gemline.rb in gemline-0.4.5

- old
+ new

@@ -32,18 +32,16 @@ def gem_not_found? !!@json.match(/(could not be found|does not exist)/) end - private def self.get_rubygem_json(gem_name) uri = URI.parse("https://rubygems.org/api/v1/gems/#{gem_name}.json") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true - # http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) response.body end @@ -64,10 +62,11 @@ def self.options_to_string(options = {}) if options[:group] options[:group] = [options[:group]].flatten.map { |x| x.to_sym } options[:group] = options[:group].first if options[:group].length == 1 end + options.inspect.delete('{}').gsub(/(?!\s)=>(?!\s)/, ' => ') end def self.gemspec_gemline(gem_name, version, options) if options[:group] && options[:group].include?('development') @@ -83,7 +82,6 @@ $stderr.puts " Gem line copied to your clipboard. Ready to paste into your Gemfile" rescue ## Yeah, I hate this too. But it does what I want -- silently fail if Clipboard fails. end end - end