osvt 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/osvt +27 -8
  2. data/lib/osvt.rb +1 -1
  3. metadata +1 -1
data/bin/osvt CHANGED
@@ -6,13 +6,12 @@ require 'rubygems/commands/query_command'
6
6
  require 'rubygems/local_remote_options'
7
7
  require 'rubygems/spec_fetcher'
8
8
  require 'rubygems/version_option'
9
- require 'rubygems/text'
10
9
  require 'net/http'
11
10
 
12
11
 
12
+
13
13
  class GemList < Gem::Command
14
14
 
15
- include Gem::Text
16
15
  include Gem::LocalRemoteOptions
17
16
  include Gem::VersionOption
18
17
 
@@ -56,7 +55,26 @@ g = GemList.new("list")
56
55
  vhash = g.execute()
57
56
  username =''
58
57
  api =''
59
- f = File.new("osvt.conf")
58
+
59
+ HOME = ENV["HOME"] || ENV["HOMEPATH"] || File::expand_path("~")
60
+ OSVT_D = File::join HOME, ".osvt"
61
+ CONFIG_F = File::join OSVT_D, "osvt.conf"
62
+
63
+ FileUtils::mkdir_p OSVT_D, :mode => 0700 unless test ?d, OSVT_D
64
+ test ?e, CONFIG_F
65
+
66
+ open(CONFIG_F, "w") { |f|
67
+ f.write "username=username\n"
68
+ f.write "api_key=api_key\n"
69
+ }
70
+
71
+ edit = (ENV["EDITOR"] || ENV["EDIT"] || "nano") + " '#{CONFIG_F}'"
72
+
73
+
74
+
75
+
76
+
77
+ f = File.new("#{CONFIG_F}")
60
78
  begin
61
79
  while (line = f.readline)
62
80
  line.chomp
@@ -73,15 +91,16 @@ rescue EOFError
73
91
  f.close
74
92
  end
75
93
 
76
- num = (1 + rand(1024))
77
- str = username<<"_"
78
- sig_id = str<<num.to_s()
94
+ #num = (1 + rand(1024))
95
+ #str = username<<"_"
96
+ #sig_id = str<<num.to_s()
97
+ sig_id = username.to_s()
79
98
 
80
99
  for v,k in vhash
81
100
 
82
- Net::HTTP.get_response(URI.parse('http://127.0.0.1:3000/components?signature_id='<<sig_id<<'&api_key='<<api<<'&name='<<username<<'&comp_name='<<v.to_s()<<'&version='<<k.to_s()))
101
+ Net::HTTP.get_response(URI.parse('http://osvt.heroku.com/components?signature_id='<<sig_id<<'&api_key='<<api<<'&name='<<username<<'&comp_name='<<v.to_s()<<'&version='<<k.to_s()))
83
102
 
84
103
  end
85
104
 
86
- Net::HTTP.get_response(URI.parse('http://127.0.0.1:3000/components?signature_id='<<sig_id<<'&api_key='<<api<<'&name='<<username<<'&comp_name='<<"ruby_gems"<<'&version='<<gems_version.to_s()))
105
+ Net::HTTP.get_response(URI.parse('http://osvt.heroku.com/components?signature_id='<<sig_id<<'&api_key='<<api<<'&name='<<username<<'&comp_name='<<"ruby_gems"<<'&version='<<gems_version.to_s()))
87
106
 
@@ -1,3 +1,3 @@
1
1
  class Osvt
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osvt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team FOSS