rudisco 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/bin/rudisco +1 -1
- data/{sources → lib}/database/rudisco.db +0 -0
- data/{sources → lib}/rudisco.rb +0 -0
- data/{sources → lib}/rudisco/cli/cli.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation/download.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation/find.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation/git_clone.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation/open.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation/show.rb +0 -0
- data/{sources → lib}/rudisco/cli/presentation/update.rb +0 -0
- data/{sources → lib}/rudisco/helpers.rb +3 -3
- data/{sources → lib}/rudisco/models/gem.rb +15 -15
- data/{sources → lib}/rudisco/models/gem/actions.rb +1 -1
- data/{sources → lib}/rudisco/models/gem/dataset_methods.rb +0 -0
- data/{sources → lib}/rudisco/models/gem/rubygems_scanner.rb +0 -0
- data/{sources → lib}/rudisco/project_structure.rb +0 -0
- data/{sources → lib}/rudisco/sqlite.rb +1 -1
- data/rakefiles/rudisco.rake +1 -1
- data/readme.md +3 -3
- data/spec/rudisco/helpers_spec.rb +33 -0
- data/spec/rudisco/models/gem_spec.rb +19 -1
- data/spec/spec_helper.rb +5 -1
- metadata +22 -21
- data/docs/images/image.jpg +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 490c4122e6c310e5a5f00d3386961739b953e6e2
|
4
|
+
data.tar.gz: eeff09d8283972388cc6cea9456e848b45cef581
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57e7934452d0733d9cf044516f75a85aa4e1d7f542febbbb22742a684242f54c9df052f14a58eb86e22ad34209d872e8f8c609e3bcb78e752eb62e178c8a3a56
|
7
|
+
data.tar.gz: 4671faa96ac2a274ea2ad6e2d30db6224016248fcfb9a1a7ecc2096452bd3ab82bb873be631a96e088eda8897549c7200cd70b7d01e74ca172a690f70d4743f5
|
data/bin/rudisco
CHANGED
Binary file
|
data/{sources → lib}/rudisco.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -8,7 +8,7 @@ module Rudisco
|
|
8
8
|
# @param [String] url
|
9
9
|
|
10
10
|
def self.open_in_browser(url)
|
11
|
-
|
11
|
+
raise NotAUrl, url unless url =~ URI::regexp(['http','https'])
|
12
12
|
|
13
13
|
if defined?(Launchy) && Launchy.respond_to?(:open)
|
14
14
|
Launchy.open url
|
@@ -36,7 +36,7 @@ module Rudisco
|
|
36
36
|
# Raised when +path+ is not a path to directory.
|
37
37
|
|
38
38
|
def self.download(url, path)
|
39
|
-
raise NotAUrl, url unless url
|
39
|
+
raise NotAUrl, url unless url =~ URI::regexp(['http','https'])
|
40
40
|
raise DirNotExists, path unless Dir.exists? path
|
41
41
|
|
42
42
|
system "wget -P #{path} #{url} > /dev/null 2>&1"
|
@@ -56,7 +56,7 @@ module Rudisco
|
|
56
56
|
# where it should be saved already exists.
|
57
57
|
|
58
58
|
def self.git_clone(url, path)
|
59
|
-
raise NotAUrl, url unless url
|
59
|
+
raise NotAUrl, url unless url =~ URI::regexp(['http','https'])
|
60
60
|
raise DirShouldNotExists, path if Dir.exists? path
|
61
61
|
|
62
62
|
system "git clone #{url} #{path} > /dev/null 2>&1"
|
@@ -8,23 +8,23 @@ module Rudisco
|
|
8
8
|
# CREATE TABLE `gems` (
|
9
9
|
# `id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
10
10
|
#
|
11
|
-
# `name`
|
12
|
-
# `description`
|
13
|
-
# `authors`
|
14
|
-
# `version`
|
15
|
-
# `license`
|
16
|
-
# `sha`
|
11
|
+
# `name` Text,
|
12
|
+
# `description` Text,
|
13
|
+
# `authors` Text,
|
14
|
+
# `version` Text,
|
15
|
+
# `license` Text,
|
16
|
+
# `sha` Text,
|
17
17
|
#
|
18
|
-
# `source_code_url`
|
19
|
-
# `project_url`
|
20
|
-
# `gem_url`
|
21
|
-
# `wiki_url`
|
22
|
-
# `documentation_url`
|
23
|
-
# `mailing_list_url`
|
24
|
-
# `bug_tracker_url`
|
18
|
+
# `source_code_url` Text,
|
19
|
+
# `project_url` Text,
|
20
|
+
# `gem_url` Text,
|
21
|
+
# `wiki_url` Text,
|
22
|
+
# `documentation_url` Text,
|
23
|
+
# `mailing_list_url` Text,
|
24
|
+
# `bug_tracker_url` Text,
|
25
25
|
#
|
26
|
-
# `total_downloads`
|
27
|
-
# `version_downloads`
|
26
|
+
# `total_downloads` Integer,
|
27
|
+
# `version_downloads` Integer,
|
28
28
|
#
|
29
29
|
# `need_update` Boolean DEFAULT (1)
|
30
30
|
# );
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
module Rudisco
|
4
4
|
path_to_database =
|
5
|
-
File.join(__dir__, '../../
|
5
|
+
ENV['RUDISCO_DB'] || File.join(__dir__, '../../lib/database/rudisco.db')
|
6
6
|
|
7
7
|
Sequel.connect "sqlite://#{path_to_database}",
|
8
8
|
max_connections: 40,
|
data/rakefiles/rudisco.rake
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
namespace 'Rudisco' do
|
3
3
|
desc "(long-term task) Starts multithread Rudisco::Gem table update"
|
4
4
|
task 'update' do
|
5
|
-
require File.join(__dir__, '..', '
|
5
|
+
require File.join(__dir__, '..', 'lib', 'rudisco.rb')
|
6
6
|
|
7
7
|
puts "task Rudisco:update launched!"
|
8
8
|
|
data/readme.md
CHANGED
@@ -58,7 +58,7 @@ Table _gems_ consist of next columns: _name, description, authors, version, lice
|
|
58
58
|
```
|
59
59
|
### Update database
|
60
60
|
|
61
|
-
####
|
61
|
+
#### Through CLI
|
62
62
|
|
63
63
|
```shell
|
64
64
|
$ gem install rudisco
|
@@ -75,9 +75,9 @@ Table _gems_ consist of next columns: _name, description, authors, version, lice
|
|
75
75
|
|
76
76
|
## CLI
|
77
77
|
|
78
|
-

|
79
79
|
|
80
|
-
###
|
80
|
+
### Commands list
|
81
81
|
|
82
82
|
```shell
|
83
83
|
$ rudisco clone GEM_NAME # Clones gem sources from git
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
module Rudisco
|
5
|
+
describe Helpers do
|
6
|
+
context "#open_in_browser" do
|
7
|
+
it 'raises an exception when +url+ is not a string' do
|
8
|
+
expect { described_class.open_in_browser(:url) }
|
9
|
+
.to raise_exception described_class::NotAUrl
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'raises an exception when +url+ is a empty string' do
|
13
|
+
expect { described_class.open_in_browser('') }
|
14
|
+
.to raise_exception described_class::NotAUrl
|
15
|
+
end
|
16
|
+
end # context "#open_in_browser"
|
17
|
+
|
18
|
+
|
19
|
+
context "#download" do
|
20
|
+
it 'raises an exception when +url+ is a empty string' do
|
21
|
+
expect { described_class.download('', nil) }
|
22
|
+
.to raise_exception described_class::NotAUrl
|
23
|
+
end
|
24
|
+
end # context "#download"
|
25
|
+
|
26
|
+
context "#git_clone" do
|
27
|
+
it 'raises an exception when +url+ is a empty string' do
|
28
|
+
expect { described_class.git_clone('', nil) }
|
29
|
+
.to raise_exception described_class::NotAUrl
|
30
|
+
end
|
31
|
+
end # context "#git_clone"
|
32
|
+
end # describe "Helpers"
|
33
|
+
end # module Rudisco
|
@@ -9,7 +9,7 @@ module Rudisco
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'works as Sequel ORM' do
|
12
|
-
expect(described_class.where {total_downloads >
|
12
|
+
expect(described_class.where {total_downloads > 30 }.count)
|
13
13
|
.to be > 0
|
14
14
|
end
|
15
15
|
|
@@ -35,6 +35,24 @@ module Rudisco
|
|
35
35
|
expect{ sample.action :misspelled_action }
|
36
36
|
.to raise_exception GemActions::Unknown
|
37
37
|
end
|
38
|
+
|
39
|
+
it 'completes an action for single cortege' do
|
40
|
+
allow_any_instance_of(Rudisco::GemActions)
|
41
|
+
.to receive(:open_in_browser).and_throw(:method_called)
|
42
|
+
|
43
|
+
cortege = described_class.first
|
44
|
+
expect{cortege.action :open_in_browser}.to throw_symbol
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'completes an action for each cortege in Gems#dataset' do
|
48
|
+
allow_any_instance_of(Rudisco::GemActions)
|
49
|
+
.to receive(:open_in_browser).and_throw(:method_called)
|
50
|
+
|
51
|
+
dataset = described_class.limit(3)
|
52
|
+
dataset.each do |cortege|
|
53
|
+
expect{cortege.action :open_in_browser}.to throw_symbol
|
54
|
+
end
|
55
|
+
end
|
38
56
|
end # describe "#action"
|
39
57
|
end # describe Gem
|
40
58
|
end # module Rudisco
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rudisco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuzichev Michael
|
@@ -120,27 +120,27 @@ files:
|
|
120
120
|
- Gemfile
|
121
121
|
- Rakefile
|
122
122
|
- bin/rudisco
|
123
|
-
-
|
123
|
+
- lib/database/rudisco.db
|
124
|
+
- lib/rudisco.rb
|
125
|
+
- lib/rudisco/cli/cli.rb
|
126
|
+
- lib/rudisco/cli/presentation.rb
|
127
|
+
- lib/rudisco/cli/presentation/download.rb
|
128
|
+
- lib/rudisco/cli/presentation/find.rb
|
129
|
+
- lib/rudisco/cli/presentation/git_clone.rb
|
130
|
+
- lib/rudisco/cli/presentation/open.rb
|
131
|
+
- lib/rudisco/cli/presentation/show.rb
|
132
|
+
- lib/rudisco/cli/presentation/update.rb
|
133
|
+
- lib/rudisco/helpers.rb
|
134
|
+
- lib/rudisco/models/gem.rb
|
135
|
+
- lib/rudisco/models/gem/actions.rb
|
136
|
+
- lib/rudisco/models/gem/dataset_methods.rb
|
137
|
+
- lib/rudisco/models/gem/rubygems_scanner.rb
|
138
|
+
- lib/rudisco/project_structure.rb
|
139
|
+
- lib/rudisco/sqlite.rb
|
124
140
|
- license.md
|
125
141
|
- rakefiles/rudisco.rake
|
126
142
|
- readme.md
|
127
|
-
-
|
128
|
-
- sources/rudisco.rb
|
129
|
-
- sources/rudisco/cli/cli.rb
|
130
|
-
- sources/rudisco/cli/presentation.rb
|
131
|
-
- sources/rudisco/cli/presentation/download.rb
|
132
|
-
- sources/rudisco/cli/presentation/find.rb
|
133
|
-
- sources/rudisco/cli/presentation/git_clone.rb
|
134
|
-
- sources/rudisco/cli/presentation/open.rb
|
135
|
-
- sources/rudisco/cli/presentation/show.rb
|
136
|
-
- sources/rudisco/cli/presentation/update.rb
|
137
|
-
- sources/rudisco/helpers.rb
|
138
|
-
- sources/rudisco/models/gem.rb
|
139
|
-
- sources/rudisco/models/gem/actions.rb
|
140
|
-
- sources/rudisco/models/gem/dataset_methods.rb
|
141
|
-
- sources/rudisco/models/gem/rubygems_scanner.rb
|
142
|
-
- sources/rudisco/project_structure.rb
|
143
|
-
- sources/rudisco/sqlite.rb
|
143
|
+
- spec/rudisco/helpers_spec.rb
|
144
144
|
- spec/rudisco/models/gem_spec.rb
|
145
145
|
- spec/spec_helper.rb
|
146
146
|
homepage: https://github.com/Medvedu/rudisco
|
@@ -150,7 +150,7 @@ metadata: {}
|
|
150
150
|
post_install_message:
|
151
151
|
rdoc_options: []
|
152
152
|
require_paths:
|
153
|
-
-
|
153
|
+
- lib
|
154
154
|
required_ruby_version: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - ">="
|
@@ -165,7 +165,7 @@ requirements:
|
|
165
165
|
- wget
|
166
166
|
- git
|
167
167
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.6.8
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: 'Rubygems sqlite3 database (includes information about ~ 126000 gems). Table
|
@@ -173,4 +173,5 @@ summary: 'Rubygems sqlite3 database (includes information about ~ 126000 gems).
|
|
173
173
|
source_code_url and more. Supports CLI.'
|
174
174
|
test_files:
|
175
175
|
- spec/spec_helper.rb
|
176
|
+
- spec/rudisco/helpers_spec.rb
|
176
177
|
- spec/rudisco/models/gem_spec.rb
|
data/docs/images/image.jpg
DELETED
Binary file
|