osvt 1.0.0

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.
data/.autotest ADDED
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
data/History.txt ADDED
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2010-03-15
2
+
3
+ * 1 major enhancement
4
+
5
+ * OSVT!
6
+
data/Manifest.txt ADDED
@@ -0,0 +1,8 @@
1
+ .autotest
2
+ History.txt
3
+ Manifest.txt
4
+ README.txt
5
+ Rakefile
6
+ bin/osvt
7
+ lib/osvt.rb
8
+ test/test_osvt.rb
data/README.txt ADDED
@@ -0,0 +1,57 @@
1
+ = osvt
2
+
3
+ * FIX (url)
4
+
5
+ == DESCRIPTION:
6
+
7
+ FIX (describe your package)
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * FIX (list of features or problems)
12
+
13
+ == SYNOPSIS:
14
+
15
+ FIX (code sample of usage)
16
+
17
+ == REQUIREMENTS:
18
+
19
+ * FIX (list of requirements)
20
+
21
+ == INSTALL:
22
+
23
+ * FIX (sudo gem install, anything else)
24
+
25
+ == DEVELOPERS:
26
+
27
+ After checking out the source, run:
28
+
29
+ $ rake newb
30
+
31
+ This task will install any missing dependencies, run the tests/specs,
32
+ and generate the RDoc.
33
+
34
+ == LICENSE:
35
+
36
+ (The MIT License)
37
+
38
+ Copyright (c) 2010 FIX
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining
41
+ a copy of this software and associated documentation files (the
42
+ 'Software'), to deal in the Software without restriction, including
43
+ without limitation the rights to use, copy, modify, merge, publish,
44
+ distribute, sublicense, and/or sell copies of the Software, and to
45
+ permit persons to whom the Software is furnished to do so, subject to
46
+ the following conditions:
47
+
48
+ The above copyright notice and this permission notice shall be
49
+ included in all copies or substantial portions of the Software.
50
+
51
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
52
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
54
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
55
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
56
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
57
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ # -*- ruby -*-
2
+ require 'rubygems'
3
+ require 'hoe'
4
+ $:.unshift(File.dirname(__FILE__) + "/lib")
5
+ require 'osvt'
6
+
7
+ Hoe.new('Osvt', Osvt::VERSION) do |p|
8
+
9
+ p.name = "osvt"
10
+ p.author = "Team FOSS"
11
+ p.description = "Open Source Version Tracker"
12
+ p.email = 'osvt@gmail.com'
13
+ p.summary = "OSVT"
14
+ p.url = "http://osvt.heroku.com"
15
+ p.remote_rdoc_dir = '' # Release to root
16
+ # * extra_deps - An array of rubygem dependencies.
17
+ end
18
+
19
+
20
+ desc "Release and publish documentation"
21
+ task :repubdoc => [:release, :publish_docs]
22
+
data/bin/osvt ADDED
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'rubygems'
4
+ require 'rubygems/command'
5
+ require 'rubygems/commands/query_command'
6
+ require 'rubygems/local_remote_options'
7
+ require 'rubygems/spec_fetcher'
8
+ require 'rubygems/version_option'
9
+ require 'rubygems/text'
10
+ require 'net/http'
11
+
12
+
13
+ class GemList < Gem::Command
14
+
15
+ include Gem::Text
16
+ include Gem::LocalRemoteOptions
17
+ include Gem::VersionOption
18
+
19
+ def initialize(name = 'query',
20
+ summary = 'Query gem information in local or remote repositories')
21
+ super name, summary,
22
+ :name => //, :domain => :local, :details => false, :versions => true,
23
+ :installed => false, :version => Gem::Requirement.default
24
+
25
+
26
+ add_option('-n', '--name-matches REGEXP',
27
+ 'Name of gem(s) to query on matches the',
28
+ 'provided REGEXP') do |value, options|
29
+ options[:name] = /#{value}/i
30
+ end
31
+
32
+ end
33
+
34
+
35
+ def execute
36
+ exit_code = 0
37
+
38
+ name = options[:name]
39
+
40
+ dep = Gem::Dependency.new name, Gem::Requirement.default
41
+ specs = Gem.source_index.search dep
42
+ vhash = {}
43
+ spec_tuples = specs.map do |spec|
44
+ [[spec.name, spec.version, spec.original_platform, spec], :local]
45
+ vhash[spec.name] = spec.version
46
+ end
47
+ return vhash
48
+
49
+
50
+ end
51
+
52
+ end
53
+
54
+ gems_version = Gem::RubyGemsVersion
55
+ g = GemList.new("list")
56
+ vhash = g.execute()
57
+ username =''
58
+ api =''
59
+ f = File.new("osvt.conf")
60
+ begin
61
+ while (line = f.readline)
62
+ line.chomp
63
+
64
+ if line =~ /(username)=(.+?)*/
65
+ username = $2
66
+ end
67
+
68
+ if line =~ /(api_key)=(.+?)*/
69
+ api = $2
70
+ end
71
+ end
72
+ rescue EOFError
73
+ f.close
74
+ end
75
+
76
+ num = (1 + rand(1024))
77
+ str = username<<"_"
78
+ sig_id = str<<num.to_s()
79
+
80
+ for v,k in vhash
81
+
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()))
83
+
84
+ end
85
+
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()))
87
+
data/lib/osvt.rb ADDED
@@ -0,0 +1,3 @@
1
+ class Osvt
2
+ VERSION = '1.0.0'
3
+ end
data/test/test_osvt.rb ADDED
@@ -0,0 +1,8 @@
1
+ require "test/unit"
2
+ require "osvt"
3
+
4
+ class TestOsvt < Test::Unit::TestCase
5
+ def test_sanity
6
+ flunk "write tests or I will kneecap you"
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: osvt
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Team FOSS
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-03-15 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rubyforge
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.3
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: gemcutter
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: hoe
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.5.0
44
+ version:
45
+ description: Open Source Version Tracker
46
+ email: osvt@gmail.com
47
+ executables:
48
+ - osvt
49
+ extensions: []
50
+
51
+ extra_rdoc_files:
52
+ - History.txt
53
+ - Manifest.txt
54
+ - README.txt
55
+ files:
56
+ - .autotest
57
+ - History.txt
58
+ - Manifest.txt
59
+ - README.txt
60
+ - Rakefile
61
+ - bin/osvt
62
+ - lib/osvt.rb
63
+ - test/test_osvt.rb
64
+ has_rdoc: true
65
+ homepage: http://osvt.heroku.com
66
+ licenses: []
67
+
68
+ post_install_message:
69
+ rdoc_options:
70
+ - --main
71
+ - README.txt
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ version:
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
86
+ requirements: []
87
+
88
+ rubyforge_project: osvt
89
+ rubygems_version: 1.3.5
90
+ signing_key:
91
+ specification_version: 3
92
+ summary: OSVT
93
+ test_files:
94
+ - test/test_osvt.rb