veye 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/DEPENDENCIES.md +25 -0
- data/Gemfile.lock +23 -18
- data/Makefile +2 -0
- data/README.md +32 -8
- data/bin/veye +7 -4
- data/lib/veye/api/resource.rb +3 -6
- data/lib/veye/helpers/format_helpers.rb +11 -0
- data/lib/veye/package/follow.rb +1 -1
- data/lib/veye/package/info.rb +5 -2
- data/lib/veye/package/search.rb +4 -1
- data/lib/veye/pagination/show.rb +5 -2
- data/lib/veye/project/check.rb +14 -4
- data/lib/veye/project/licence.rb +4 -0
- data/lib/veye/project/project_csv.rb +3 -1
- data/lib/veye/project/project_dependency_csv.rb +15 -10
- data/lib/veye/project/project_dependency_json.rb +1 -1
- data/lib/veye/project/project_dependency_markdown.rb +47 -0
- data/lib/veye/project/project_dependency_pretty.rb +4 -3
- data/lib/veye/project/project_dependency_table.rb +12 -3
- data/lib/veye/project/project_json.rb +1 -3
- data/lib/veye/project/project_markdown.rb +38 -0
- data/lib/veye/user/me.rb +4 -0
- data/lib/veye/version.rb +1 -1
- data/lib/veye.rb +15 -9
- metadata +45 -6
- checksums.yaml +0 -15
data/DEPENDENCIES.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Dependencies
|
2
|
+
|
3
|
+
index|name |prod_key |outdated|version_current|version_requested|stable|license
|
4
|
+
-----|------------------|------------------|--------|---------------|-----------------|------|------------------------
|
5
|
+
1 |veye |veye | |0.0.5 |0.0.5 |stable|MIT
|
6
|
+
2 |awesome_print |awesome_print | |1.2.0 |1.2.0 |stable|MIT
|
7
|
+
3 |gli |gli | |2.8.0 |2.8.0 |stable|unknown
|
8
|
+
4 |render-as-markdown|render-as-markdown| |0.0.3 |0.0.3 |stable|MIT
|
9
|
+
5 |rest-client |rest-client | |1.6.7 |1.6.7 |stable|MIT
|
10
|
+
6 |terminal-table |terminal-table | |1.4.5 |1.4.5 |stable|unknown
|
11
|
+
7 |aruba |aruba | |0.5.3 |0.5.3 |stable|MIT
|
12
|
+
8 |childprocess |childprocess | |0.3.9 |0.3.9 |stable|MIT
|
13
|
+
9 |cucumber |cucumber | |1.3.8 |1.3.8 |stable|unknown
|
14
|
+
10 |rspec-expectations|rspec-expectations| |2.14.3 |2.14.3 |stable|MIT
|
15
|
+
11 |builder |builder | |3.2.2 |3.2.2 |stable|MIT
|
16
|
+
12 |ffi |ffi | |1.9.0 |1.9.0 |stable|LGPL 3
|
17
|
+
13 |diff-lcs |diff-lcs | |1.2.4 |1.2.4 |stable|MIT
|
18
|
+
14 |gherkin |gherkin |outdated|3 |2.12.1 |stable|MIT
|
19
|
+
15 |multi_json |multi_json | |1.8.1 |1.8.1 |stable|MIT
|
20
|
+
16 |multi_test |multi_test | |0.0.2 |0.0.2 |stable|UNKNOWN
|
21
|
+
17 |json |json | |1.8.0 |1.8.0 |stable|Ruby
|
22
|
+
18 |mime-types |mime-types | |1.25 |1.25 |stable|MIT, Artistic 2.0, GPL-2
|
23
|
+
19 |rainbow |rainbow |outdated|3.1 |1.1.4 |stable|MIT
|
24
|
+
20 |rake |rake | |10.1.0 |10.1.0 |stable|MIT
|
25
|
+
21 |rdoc |rdoc | |4.0.1 |4.0.1 |stable|GPL 2
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
veye (0.0.
|
4
|
+
veye (0.0.6)
|
5
5
|
awesome_print (= 1.2.0)
|
6
6
|
gli (= 2.8.0)
|
7
7
|
rainbow
|
8
|
+
render-as-markdown (~> 0.0.1)
|
8
9
|
rest-client (= 1.6.7)
|
9
10
|
terminal-table (= 1.4.5)
|
10
11
|
|
11
12
|
GEM
|
12
13
|
remote: https://rubygems.org/
|
13
14
|
specs:
|
14
|
-
aruba (0.5.
|
15
|
-
childprocess (
|
15
|
+
aruba (0.5.3)
|
16
|
+
childprocess (>= 0.3.6)
|
16
17
|
cucumber (>= 1.1.1)
|
17
18
|
rspec-expectations (>= 2.7.0)
|
18
19
|
awesome_print (1.2.0)
|
19
|
-
builder (3.
|
20
|
-
childprocess (0.3.
|
21
|
-
ffi (~> 1.0, >= 1.0.
|
22
|
-
cucumber (1.
|
20
|
+
builder (3.2.2)
|
21
|
+
childprocess (0.3.9)
|
22
|
+
ffi (~> 1.0, >= 1.0.11)
|
23
|
+
cucumber (1.3.8)
|
23
24
|
builder (>= 2.1.2)
|
24
25
|
diff-lcs (>= 1.1.3)
|
25
|
-
gherkin (~> 2.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
gherkin (~> 2.12.1)
|
27
|
+
multi_json (>= 1.7.5, < 2.0)
|
28
|
+
multi_test (>= 0.0.2)
|
29
|
+
diff-lcs (1.2.4)
|
30
|
+
ffi (1.9.0)
|
31
|
+
gherkin (2.12.1)
|
32
|
+
multi_json (~> 1.3)
|
31
33
|
gli (2.8.0)
|
32
|
-
json (1.
|
34
|
+
json (1.8.0)
|
33
35
|
mime-types (1.25)
|
36
|
+
multi_json (1.8.1)
|
37
|
+
multi_test (0.0.2)
|
34
38
|
rainbow (1.1.4)
|
35
|
-
rake (10.0
|
36
|
-
rdoc (
|
39
|
+
rake (10.1.0)
|
40
|
+
rdoc (4.0.1)
|
37
41
|
json (~> 1.4)
|
42
|
+
render-as-markdown (0.0.3)
|
38
43
|
rest-client (1.6.7)
|
39
44
|
mime-types (>= 1.16)
|
40
|
-
rspec-expectations (2.
|
41
|
-
diff-lcs (
|
45
|
+
rspec-expectations (2.14.3)
|
46
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
42
47
|
terminal-table (1.4.5)
|
43
48
|
|
44
49
|
PLATFORMS
|
data/Makefile
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Veye
|
2
2
|
|
3
|
+
[![Dependency Status](https://www.versioneye.com/ruby/veye/0.0.5/badge.png)](https://www.versioneye.com/ruby/veye/0.0.5)
|
4
|
+
|
3
5
|
[VersionEye](http://www.versioneye.com/) is a cross-platform search engine and crowdsourcing app for opensource software libraries.
|
4
6
|
|
5
7
|
* Take advantage of the extended search to find any library you look for.
|
@@ -85,7 +87,7 @@ You can use this service to check does the tool works and tests is our API acces
|
|
85
87
|
|
86
88
|
### Search packages
|
87
89
|
|
88
|
-
This command opens window to magnificient world of software packages - VersionEye has ~
|
90
|
+
This command opens window to magnificient world of software packages - VersionEye has ~ 250K software libraries and it's reachable via your commandline.
|
89
91
|
|
90
92
|
###### Get command help
|
91
93
|
|
@@ -116,9 +118,13 @@ This command opens window to magnificient world of software packages - VersionEy
|
|
116
118
|
$> veye search junit --page 3 --no-pagination
|
117
119
|
```
|
118
120
|
|
119
|
-
|
121
|
+
### Output formats
|
122
|
+
|
123
|
+
All commands support format-flag, that allows you change output format.
|
120
124
|
|
121
|
-
|
125
|
+
###### pretty print
|
126
|
+
|
127
|
+
Prettyprint is human readable output with colors. It's designed after other ruby command-line tools.
|
122
128
|
|
123
129
|
```bash
|
124
130
|
$> veye search json --format=pretty
|
@@ -126,7 +132,8 @@ This command opens window to magnificient world of software packages - VersionEy
|
|
126
132
|
|
127
133
|
![Pretty format](https://s3-eu-west-1.amazonaws.com/veye/search_format_pretty.png)
|
128
134
|
|
129
|
-
|
135
|
+
###### CSV
|
136
|
+
CSV is good format for unix command line tools as [awk](http://www.gnu.org/software/gawk/manual/gawk.html)
|
130
137
|
|
131
138
|
```bash
|
132
139
|
$> veye search json --format=csv
|
@@ -134,7 +141,9 @@ This command opens window to magnificient world of software packages - VersionEy
|
|
134
141
|
|
135
142
|
![CSV format](https://s3-eu-west-1.amazonaws.com/veye/search_format_csv.png)
|
136
143
|
|
137
|
-
|
144
|
+
###### JSON
|
145
|
+
|
146
|
+
It also supports JSON to manipulate results with [jq](http://stedolan.github.com/jq/) .
|
138
147
|
Check out our jq recipes in [wiki](https://github.com/versioneye/veye/wiki/jq-recipes) .
|
139
148
|
|
140
149
|
|
@@ -144,14 +153,29 @@ This command opens window to magnificient world of software packages - VersionEy
|
|
144
153
|
|
145
154
|
![Json format](https://s3-eu-west-1.amazonaws.com/veye/search_format_json.png)
|
146
155
|
|
147
|
-
|
148
|
-
|
156
|
+
###### Table view
|
157
|
+
|
158
|
+
A Tabular view for bigger screens. It's shows results as one Excel sheet - title and content.
|
159
|
+
|
149
160
|
```bash
|
150
161
|
$> veye search json --format=table
|
151
162
|
```
|
152
163
|
![Table output](https://s3-eu-west-1.amazonaws.com/veye/search_format_table.png)
|
153
164
|
|
154
165
|
|
166
|
+
###### Markdown
|
167
|
+
|
168
|
+
This flag formats your results in markdown.
|
169
|
+
|
170
|
+
Here's dependencies of demo project formatted as [markdown table](https://gist.github.com/timgluz/6857422).
|
171
|
+
|
172
|
+
```
|
173
|
+
|
174
|
+
$> veye projects show rubygem_gemfile_lock_1 --format=md
|
175
|
+
$> veye projects show rubygem_gemfile_lock_1 --format=md > dependencies.md
|
176
|
+
```
|
177
|
+
|
178
|
+
|
155
179
|
###### Empty response
|
156
180
|
|
157
181
|
There will be situation, when [VersionEye](http://versioneye.com) dont have information about your search, then you will see similar response on commandline:
|
@@ -277,5 +301,5 @@ This command removes the specified project from your project's list.
|
|
277
301
|
|
278
302
|
```
|
279
303
|
$> veye me favorites
|
280
|
-
$> veye me favorites --page=2
|
304
|
+
$> veye me favorites --page=2 --format=table
|
281
305
|
```
|
data/bin/veye
CHANGED
@@ -15,6 +15,8 @@ program_long_desc Veye::BIGEYE.foreground(:green)
|
|
15
15
|
wrap_help_text :verbatim
|
16
16
|
version Veye::VERSION
|
17
17
|
|
18
|
+
COMMANDS_WITHOUT_API_KEY = [:help, :ping, :search]
|
19
|
+
|
18
20
|
config_file '.veye.rc'
|
19
21
|
|
20
22
|
desc 'set api key'
|
@@ -33,16 +35,17 @@ desc 'set connection protocol'
|
|
33
35
|
flag :protocol, :default_value => "http"
|
34
36
|
|
35
37
|
desc 'set folder of veye_cert.pem'
|
36
|
-
flag :ssl_path, :default_value => "~/.
|
38
|
+
flag :ssl_path, :default_value => "~/.ssh"
|
37
39
|
|
38
40
|
desc "don't use colors"
|
39
41
|
switch 'color', :default_value => true, :negetable => true
|
40
42
|
|
41
|
-
pre do |global_options,
|
43
|
+
pre do |global_options, command, args|
|
42
44
|
check_config_file
|
43
45
|
$global_options = init_environment
|
44
46
|
$global_options.merge!(global_options)
|
45
|
-
|
47
|
+
needs_api_key = ! COMMANDS_WITHOUT_API_KEY.member?(command.name)
|
48
|
+
check_configs($global_options, needs_api_key)
|
46
49
|
$global_options[:url] = Veye::API::Resource.build_url($global_options)
|
47
50
|
end
|
48
51
|
|
@@ -250,7 +253,7 @@ command :projects do |c|
|
|
250
253
|
|
251
254
|
c.desc "show licences of subdependencies"
|
252
255
|
c.arg_name "project_key"
|
253
|
-
c.command :
|
256
|
+
c.command :licenses do |licences|
|
254
257
|
licences.action do |global_options, options, args|
|
255
258
|
help_now!("Project's key is unspecified".foreground(:red)) if args.empty?
|
256
259
|
proj_key = args.shift
|
data/lib/veye/api/resource.rb
CHANGED
@@ -12,12 +12,9 @@ module Veye
|
|
12
12
|
ssl_path = File.expand_path($global_options[:ssl_path])
|
13
13
|
@resource = RestClient::Resource.new(
|
14
14
|
@full_path,
|
15
|
-
:ssl_client_cert =>
|
16
|
-
|
17
|
-
:
|
18
|
-
File.read("#{ssl_path}/veye_key.pem"), "passphrase, if any"),
|
19
|
-
:ssl_ca_file => "ca_certificate.pem",
|
20
|
-
:verify_ssl => OpenSSL::SSL::VERIFY_PEER
|
15
|
+
:ssl_client_cert => OpenSSL::PKey::RSA.new(File.read("#{ssl_path}/veye_cert.pem")),
|
16
|
+
:ssl_client_key => OpenSSL::PKey::RSA.new(File.read("#{ssl_path}/veye_key.pem")),
|
17
|
+
:verify_ssl => OpenSSL::SSL::VERIFY_NONE
|
21
18
|
)
|
22
19
|
end
|
23
20
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module FormatHelpers
|
2
|
+
def supported_format?(output_formats, format)
|
3
|
+
unless output_formats.has_key?(format)
|
4
|
+
msg = "This command doesnt support output format: `#{format}`\n".foreground(:red)
|
5
|
+
msg += "Supported formats: #{output_formats.keys.join(', ')}\n"
|
6
|
+
exit_now! msg
|
7
|
+
end
|
8
|
+
true
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
data/lib/veye/package/follow.rb
CHANGED
data/lib/veye/package/info.rb
CHANGED
@@ -4,9 +4,10 @@ require_relative 'info_pretty.rb'
|
|
4
4
|
require_relative 'info_table.rb'
|
5
5
|
|
6
6
|
module Veye
|
7
|
-
module Package
|
8
|
-
|
7
|
+
module Package
|
9
8
|
class Info
|
9
|
+
extend FormatHelpers
|
10
|
+
|
10
11
|
@@output_formats = {
|
11
12
|
'csv' => InfoCSV.new,
|
12
13
|
'json' => InfoJSON.new,
|
@@ -39,6 +40,8 @@ module Veye
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def self.format(results, format = 'pretty')
|
43
|
+
self.supported_format?(@@output_formats, format)
|
44
|
+
|
42
45
|
formatter = @@output_formats[format]
|
43
46
|
formatter.before
|
44
47
|
formatter.format(results)
|
data/lib/veye/package/search.rb
CHANGED
@@ -7,6 +7,8 @@ module Veye
|
|
7
7
|
module Package
|
8
8
|
|
9
9
|
class Search
|
10
|
+
extend FormatHelpers
|
11
|
+
|
10
12
|
@@output_formats = {
|
11
13
|
'csv' => SearchCSV.new,
|
12
14
|
'json' => SearchJSON.new,
|
@@ -33,7 +35,8 @@ module Veye
|
|
33
35
|
end
|
34
36
|
|
35
37
|
def self.format(search_results, format = 'pretty', paging = nil)
|
36
|
-
|
38
|
+
self.supported_format?(@@output_formats, format)
|
39
|
+
|
37
40
|
formatter = @@output_formats[format]
|
38
41
|
formatter.before
|
39
42
|
formatter.format(search_results)
|
data/lib/veye/pagination/show.rb
CHANGED
@@ -6,6 +6,8 @@ require_relative 'pagination_table.rb'
|
|
6
6
|
module Veye
|
7
7
|
module Pagination
|
8
8
|
class Show
|
9
|
+
extend FormatHelpers
|
10
|
+
|
9
11
|
@@pagination_formats = {
|
10
12
|
'csv' => PaginationCSV.new,
|
11
13
|
'json' => PaginationJSON.new,
|
@@ -14,8 +16,9 @@ module Veye
|
|
14
16
|
}
|
15
17
|
|
16
18
|
def self.format(paging, format = 'pretty')
|
17
|
-
|
18
|
-
|
19
|
+
self.supported_format?(@@pagination_formats, format)
|
20
|
+
|
21
|
+
formatter = @@pagination_formats[format]
|
19
22
|
formatter.before
|
20
23
|
formatter.format paging
|
21
24
|
formatter.after
|
data/lib/veye/project/check.rb
CHANGED
@@ -4,27 +4,33 @@ require_relative 'project_csv.rb'
|
|
4
4
|
require_relative 'project_json.rb'
|
5
5
|
require_relative 'project_pretty.rb'
|
6
6
|
require_relative 'project_table.rb'
|
7
|
+
require_relative 'project_markdown.rb'
|
7
8
|
|
8
9
|
require_relative 'project_dependency_csv.rb'
|
9
10
|
require_relative 'project_dependency_json.rb'
|
10
11
|
require_relative 'project_dependency_pretty.rb'
|
11
12
|
require_relative 'project_dependency_table.rb'
|
13
|
+
require_relative 'project_dependency_markdown.rb'
|
12
14
|
|
13
15
|
module Veye
|
14
16
|
module Project
|
15
17
|
class Check
|
18
|
+
extend FormatHelpers
|
19
|
+
|
16
20
|
@@output_formats = {
|
17
21
|
"csv" => ProjectCSV.new,
|
18
22
|
"json" => ProjectJSON.new,
|
19
23
|
"pretty" => ProjectPretty.new,
|
20
|
-
"table" => ProjectTable.new
|
24
|
+
"table" => ProjectTable.new,
|
25
|
+
"md" => ProjectMarkdown.new
|
21
26
|
}
|
22
27
|
|
23
28
|
@@dependency_output_formats = {
|
24
29
|
"csv" => ProjectDependencyCSV.new,
|
25
30
|
"json" => ProjectDependencyJSON.new,
|
26
31
|
"pretty" => ProjectDependencyPretty.new,
|
27
|
-
"table" => ProjectDependencyTable.new
|
32
|
+
"table" => ProjectDependencyTable.new,
|
33
|
+
"md" => ProjectDependencyMarkdown.new
|
28
34
|
}
|
29
35
|
|
30
36
|
|
@@ -32,6 +38,7 @@ module Veye
|
|
32
38
|
project_api = API::Resource.new(RESOURCE_PATH)
|
33
39
|
qparams = {:params => {:api_key => api_key}}
|
34
40
|
|
41
|
+
|
35
42
|
project_api.resource.get(qparams) do |response, request, result|
|
36
43
|
response_data = API::JSONResponse.new(request, result, response)
|
37
44
|
end
|
@@ -105,7 +112,7 @@ module Veye
|
|
105
112
|
"Not valid project_key: `#{project_key}`")
|
106
113
|
exit_now! error_msg
|
107
114
|
end
|
108
|
-
|
115
|
+
|
109
116
|
project_url = "/#{project_key}"
|
110
117
|
qparams = {:params => {:api_key => api_key}}
|
111
118
|
project_api.resource[project_url].get(qparams) do |response, request, result|
|
@@ -128,6 +135,8 @@ module Veye
|
|
128
135
|
end
|
129
136
|
|
130
137
|
def self.format(results, format = 'pretty')
|
138
|
+
self.supported_format?(@@output_formats, format)
|
139
|
+
|
131
140
|
formatter = @@output_formats[format]
|
132
141
|
formatter.before
|
133
142
|
formatter.format results
|
@@ -135,12 +144,13 @@ module Veye
|
|
135
144
|
end
|
136
145
|
|
137
146
|
def self.format_dependencies(results, format = 'pretty')
|
147
|
+
self.supported_format?(@@dependency_output_formats, format)
|
148
|
+
|
138
149
|
formatter = @@dependency_output_formats[format]
|
139
150
|
formatter.before
|
140
151
|
formatter.format results
|
141
152
|
formatter.after
|
142
153
|
end
|
143
|
-
|
144
154
|
end
|
145
155
|
end
|
146
156
|
end
|
data/lib/veye/project/licence.rb
CHANGED
@@ -8,6 +8,8 @@ require_relative 'project_licence_table.rb'
|
|
8
8
|
module Veye
|
9
9
|
module Project
|
10
10
|
class Licence
|
11
|
+
extend FormatHelpers
|
12
|
+
|
11
13
|
@@output_formats = {
|
12
14
|
"csv" => ProjectLicenceCSV.new,
|
13
15
|
"json" => ProjectLicenceJSON.new,
|
@@ -36,6 +38,8 @@ module Veye
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def self.format(results, format = 'pretty')
|
41
|
+
self.supported_format?(@@output_formats, format)
|
42
|
+
|
39
43
|
formatter = @@output_formats[format]
|
40
44
|
formatter.before
|
41
45
|
formatter.format results
|
@@ -1,8 +1,11 @@
|
|
1
1
|
module Veye
|
2
2
|
module Project
|
3
3
|
class ProjectDependencyCSV
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
@@columns = %w{nr name prod_key outdated version_current version_requested stable license}
|
6
|
+
|
7
|
+
def before
|
8
|
+
puts @@columns.join(',') << "\n"
|
6
9
|
end
|
7
10
|
def after; end
|
8
11
|
|
@@ -10,14 +13,16 @@ module Veye
|
|
10
13
|
results = [results] if results.is_a?(Hash)
|
11
14
|
|
12
15
|
results.each_with_index do |result, index|
|
13
|
-
printf("%d,%s,%s,%s,%s,%s\n",
|
14
|
-
index + 1,
|
15
|
-
result[
|
16
|
-
result[
|
17
|
-
result[
|
18
|
-
result[
|
19
|
-
result[
|
20
|
-
|
16
|
+
printf("%d,%s,%s,%s,%s,%s,%s,%s\n",
|
17
|
+
index + 1,
|
18
|
+
result[@@columns[1]],
|
19
|
+
result[@@columns[2]],
|
20
|
+
result[@@columns[3]],
|
21
|
+
result[@@columns[4]],
|
22
|
+
result[@@columns[5]],
|
23
|
+
result[@@columns[6]],
|
24
|
+
result[@@columns[7]]
|
25
|
+
)
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'render-as-markdown'
|
2
|
+
|
3
|
+
module Veye
|
4
|
+
module Project
|
5
|
+
class ProjectDependencyMarkdown
|
6
|
+
|
7
|
+
@@columns = %w{index name prod_key outdated version_current version_requested stable license}
|
8
|
+
|
9
|
+
def before; end
|
10
|
+
|
11
|
+
def format(results)
|
12
|
+
begin
|
13
|
+
markdown = "# Dependencies\n\n"
|
14
|
+
|
15
|
+
table = RenderAsMarkdown::Table.new @@columns
|
16
|
+
|
17
|
+
results = [results] if results.is_a?(Hash)
|
18
|
+
|
19
|
+
results.each_with_index do |result, index|
|
20
|
+
# make sure this array is exactly as long as @@columns
|
21
|
+
table << [
|
22
|
+
(index + 1).to_s,
|
23
|
+
result["name"],
|
24
|
+
result["prod_key"],
|
25
|
+
result["outdated"] ? "outdated" : "ok",
|
26
|
+
result["version_current"],
|
27
|
+
result["version_requested"],
|
28
|
+
result["stable"] ? "stable": "unstable",
|
29
|
+
result["license"]
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
markdown << table.render
|
34
|
+
puts markdown
|
35
|
+
|
36
|
+
rescue => e
|
37
|
+
puts e
|
38
|
+
puts e.backtrace
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def after; end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
@@ -17,11 +17,12 @@ module Veye
|
|
17
17
|
printf("\t%-15s: %s\n", "Outdated",
|
18
18
|
"#{result['outdated']}".foreground(color))
|
19
19
|
|
20
|
-
printf("\t%-15s: %s\n", "
|
20
|
+
printf("\t%-15s: %s\n", "Current version",
|
21
21
|
"#{result['version_current']}".foreground(color))
|
22
22
|
|
23
|
-
printf("\t%-15s: %s\n", "
|
24
|
-
|
23
|
+
printf("\t%-15s: %s\n", "Requested version", result["version_requested"])
|
24
|
+
printf("\t%-15s: %s\n", "License", result["license"])
|
25
|
+
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -3,9 +3,12 @@ require 'terminal-table'
|
|
3
3
|
module Veye
|
4
4
|
module Project
|
5
5
|
class ProjectDependencyTable
|
6
|
+
|
7
|
+
@@columns = %w{index name prod_key outdated version_current version_requested stable license}
|
8
|
+
|
6
9
|
def before
|
7
10
|
@@table = Terminal::Table.new :title => "Version check",
|
8
|
-
:headings =>
|
11
|
+
:headings => @@columns
|
9
12
|
@@table.align_column(0, :right)
|
10
13
|
end
|
11
14
|
|
@@ -17,8 +20,14 @@ module Veye
|
|
17
20
|
results = [results] if results.is_a?(Hash)
|
18
21
|
|
19
22
|
results.each_with_index do |result, index|
|
20
|
-
row = [index + 1,
|
21
|
-
|
23
|
+
row = [index + 1,
|
24
|
+
result["name"],
|
25
|
+
result["prod_key"],
|
26
|
+
result["version_current"],
|
27
|
+
result["version_requested"],
|
28
|
+
result["outdated"] ? "outdated":"",
|
29
|
+
result["stable"] ? "stable": "unstable",
|
30
|
+
result["license"]]
|
22
31
|
@@table << row
|
23
32
|
end
|
24
33
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'render-as-markdown'
|
2
|
+
|
3
|
+
module Veye
|
4
|
+
module Project
|
5
|
+
class ProjectMarkdown
|
6
|
+
@@columns = %w(index name project_key project_type private period source dependencies outdated created)
|
7
|
+
|
8
|
+
def before
|
9
|
+
@@markdown = "# Project's information\n\n"
|
10
|
+
@@table = RenderAsMarkdown::Table.new @@columns
|
11
|
+
end
|
12
|
+
|
13
|
+
def after
|
14
|
+
@@markdown << @@table.render
|
15
|
+
@@markdown << "\n\n"
|
16
|
+
puts @@markdown
|
17
|
+
end
|
18
|
+
def format(results)
|
19
|
+
results = [results] if results.is_a?(Hash) #required for `project show`
|
20
|
+
|
21
|
+
results.each_with_index do |result, index|
|
22
|
+
@@table << [
|
23
|
+
(index + 1).to_s,
|
24
|
+
result["name"],
|
25
|
+
result["project_key"],
|
26
|
+
result["project_type"],
|
27
|
+
result["private"].to_s,
|
28
|
+
result["period"],
|
29
|
+
result["source"],
|
30
|
+
result["dep_number"].to_s,
|
31
|
+
result["out_number"].to_s,
|
32
|
+
result["created_at"]
|
33
|
+
]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/veye/user/me.rb
CHANGED
@@ -11,6 +11,8 @@ require_relative 'favorite_table.rb'
|
|
11
11
|
module Veye
|
12
12
|
module User
|
13
13
|
class Me
|
14
|
+
extend FormatHelpers
|
15
|
+
|
14
16
|
@@profile_formats = {
|
15
17
|
'csv' => ProfileCSV.new,
|
16
18
|
'json' => ProfileJSON.new,
|
@@ -55,6 +57,7 @@ module Veye
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def self.format_profile(results, format = 'pretty')
|
60
|
+
self.supported_format?(@@profile_formats, format)
|
58
61
|
formatter = @@profile_formats[format]
|
59
62
|
formatter.before
|
60
63
|
formatter.format(results)
|
@@ -62,6 +65,7 @@ module Veye
|
|
62
65
|
end
|
63
66
|
|
64
67
|
def self.format_favorites(results, format = 'pretty')
|
68
|
+
self.supported_format?(@@favorite_formats, format)
|
65
69
|
formatter = @@favorite_formats[format]
|
66
70
|
|
67
71
|
formatter.before
|
data/lib/veye/version.rb
CHANGED
data/lib/veye.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Add requires for other files you add to your project here, so
|
2
2
|
# you just need to require this one file in your bin file
|
3
|
+
require 'openssl'
|
4
|
+
|
5
|
+
require 'veye/helpers/format_helpers.rb'
|
6
|
+
|
3
7
|
require 'veye/version.rb'
|
4
8
|
require 'veye/service.rb'
|
5
9
|
require 'veye/api.rb'
|
@@ -30,9 +34,9 @@ def check_config_file
|
|
30
34
|
end
|
31
35
|
end
|
32
36
|
|
33
|
-
def self.check_configs(global_opts)
|
37
|
+
def self.check_configs(global_opts, needs_api_key)
|
34
38
|
check_config_file
|
35
|
-
check_api_key(global_opts)
|
39
|
+
check_api_key(global_opts) if needs_api_key
|
36
40
|
|
37
41
|
unless ssl_key_exists?(global_opts)
|
38
42
|
generate_ssl_keys(global_opts)
|
@@ -71,23 +75,25 @@ end
|
|
71
75
|
|
72
76
|
def generate_ssl_keys(global_opts)
|
73
77
|
result = false
|
74
|
-
key_command = %Q[
|
75
|
-
openssl req -x509 -newkey rsa:2048 -keyout veye_key.pem -out veye_cert.pem -nodes
|
76
|
-
]
|
77
78
|
|
78
79
|
Dir.chdir(Dir.home)
|
79
80
|
ssl_path = File.expand_path(global_opts[:ssl_path])
|
80
81
|
unless Dir.exists?(ssl_path)
|
81
|
-
|
82
|
+
print "Info: Creating folder for ssl keys: `#{ssl_path}`\n"
|
82
83
|
Dir.mkdir(ssl_path)
|
83
84
|
end
|
84
85
|
|
85
86
|
Dir.chdir(ssl_path)
|
86
|
-
|
87
|
-
|
87
|
+
|
88
|
+
key = OpenSSL::PKey::RSA.new 2048
|
89
|
+
open 'veye_key.pem', 'w' do |io| io.write(key.to_pem) end
|
90
|
+
open 'veye_cert.pem', 'w' do |io| io.write(key.public_key.to_pem) end
|
91
|
+
|
92
|
+
if ssl_key_exists?(global_opts)
|
93
|
+
print "Success: SSL keys are generated.\n"
|
88
94
|
result = true
|
89
95
|
else
|
90
|
-
print "Cant generate SSL keys. Do you have openssl installed?\n"
|
96
|
+
print "Error: Cant generate SSL keys. Do you have openssl installed?\n"
|
91
97
|
end
|
92
98
|
|
93
99
|
Dir.chdir(Dir.home)
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: veye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- VersionEye GMBH
|
@@ -10,11 +11,12 @@ authors:
|
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2013-10-
|
14
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: rake
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
18
20
|
requirements:
|
19
21
|
- - ! '>='
|
20
22
|
- !ruby/object:Gem::Version
|
@@ -22,6 +24,7 @@ dependencies:
|
|
22
24
|
type: :development
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
29
|
- - ! '>='
|
27
30
|
- !ruby/object:Gem::Version
|
@@ -29,6 +32,7 @@ dependencies:
|
|
29
32
|
- !ruby/object:Gem::Dependency
|
30
33
|
name: rdoc
|
31
34
|
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
32
36
|
requirements:
|
33
37
|
- - ! '>='
|
34
38
|
- !ruby/object:Gem::Version
|
@@ -36,6 +40,7 @@ dependencies:
|
|
36
40
|
type: :development
|
37
41
|
prerelease: false
|
38
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
39
44
|
requirements:
|
40
45
|
- - ! '>='
|
41
46
|
- !ruby/object:Gem::Version
|
@@ -43,6 +48,7 @@ dependencies:
|
|
43
48
|
- !ruby/object:Gem::Dependency
|
44
49
|
name: aruba
|
45
50
|
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
46
52
|
requirements:
|
47
53
|
- - ! '>='
|
48
54
|
- !ruby/object:Gem::Version
|
@@ -50,6 +56,7 @@ dependencies:
|
|
50
56
|
type: :development
|
51
57
|
prerelease: false
|
52
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
53
60
|
requirements:
|
54
61
|
- - ! '>='
|
55
62
|
- !ruby/object:Gem::Version
|
@@ -57,6 +64,7 @@ dependencies:
|
|
57
64
|
- !ruby/object:Gem::Dependency
|
58
65
|
name: gli
|
59
66
|
requirement: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
60
68
|
requirements:
|
61
69
|
- - '='
|
62
70
|
- !ruby/object:Gem::Version
|
@@ -64,6 +72,7 @@ dependencies:
|
|
64
72
|
type: :runtime
|
65
73
|
prerelease: false
|
66
74
|
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
67
76
|
requirements:
|
68
77
|
- - '='
|
69
78
|
- !ruby/object:Gem::Version
|
@@ -71,6 +80,7 @@ dependencies:
|
|
71
80
|
- !ruby/object:Gem::Dependency
|
72
81
|
name: rest-client
|
73
82
|
requirement: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
74
84
|
requirements:
|
75
85
|
- - '='
|
76
86
|
- !ruby/object:Gem::Version
|
@@ -78,6 +88,7 @@ dependencies:
|
|
78
88
|
type: :runtime
|
79
89
|
prerelease: false
|
80
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
81
92
|
requirements:
|
82
93
|
- - '='
|
83
94
|
- !ruby/object:Gem::Version
|
@@ -85,6 +96,7 @@ dependencies:
|
|
85
96
|
- !ruby/object:Gem::Dependency
|
86
97
|
name: awesome_print
|
87
98
|
requirement: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
88
100
|
requirements:
|
89
101
|
- - '='
|
90
102
|
- !ruby/object:Gem::Version
|
@@ -92,6 +104,7 @@ dependencies:
|
|
92
104
|
type: :runtime
|
93
105
|
prerelease: false
|
94
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
95
108
|
requirements:
|
96
109
|
- - '='
|
97
110
|
- !ruby/object:Gem::Version
|
@@ -99,6 +112,7 @@ dependencies:
|
|
99
112
|
- !ruby/object:Gem::Dependency
|
100
113
|
name: rainbow
|
101
114
|
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
102
116
|
requirements:
|
103
117
|
- - ! '>='
|
104
118
|
- !ruby/object:Gem::Version
|
@@ -106,6 +120,7 @@ dependencies:
|
|
106
120
|
type: :runtime
|
107
121
|
prerelease: false
|
108
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
109
124
|
requirements:
|
110
125
|
- - ! '>='
|
111
126
|
- !ruby/object:Gem::Version
|
@@ -113,6 +128,7 @@ dependencies:
|
|
113
128
|
- !ruby/object:Gem::Dependency
|
114
129
|
name: terminal-table
|
115
130
|
requirement: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
116
132
|
requirements:
|
117
133
|
- - '='
|
118
134
|
- !ruby/object:Gem::Version
|
@@ -120,11 +136,28 @@ dependencies:
|
|
120
136
|
type: :runtime
|
121
137
|
prerelease: false
|
122
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
123
140
|
requirements:
|
124
141
|
- - '='
|
125
142
|
- !ruby/object:Gem::Version
|
126
143
|
version: 1.4.5
|
127
|
-
|
144
|
+
- !ruby/object:Gem::Dependency
|
145
|
+
name: render-as-markdown
|
146
|
+
requirement: !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
148
|
+
requirements:
|
149
|
+
- - ~>
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: 0.0.1
|
152
|
+
type: :runtime
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
156
|
+
requirements:
|
157
|
+
- - ~>
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.0.1
|
160
|
+
description: ! "\n Veye is commandline tool like Heroku has own ToolBelt,\n and
|
128
161
|
purpose of this tool is to make developer's life even\n more simpler and keep
|
129
162
|
you up-to-date with freshest packages.\n "
|
130
163
|
email: contact@versioneye.com
|
@@ -140,6 +173,7 @@ files:
|
|
140
173
|
- lib/veye/api/json_response.rb
|
141
174
|
- lib/veye/api/resource.rb
|
142
175
|
- lib/veye/api.rb
|
176
|
+
- lib/veye/helpers/format_helpers.rb
|
143
177
|
- lib/veye/package/follow.rb
|
144
178
|
- lib/veye/package/info.rb
|
145
179
|
- lib/veye/package/info_csv.rb
|
@@ -163,6 +197,7 @@ files:
|
|
163
197
|
- lib/veye/project/project_csv.rb
|
164
198
|
- lib/veye/project/project_dependency_csv.rb
|
165
199
|
- lib/veye/project/project_dependency_json.rb
|
200
|
+
- lib/veye/project/project_dependency_markdown.rb
|
166
201
|
- lib/veye/project/project_dependency_pretty.rb
|
167
202
|
- lib/veye/project/project_dependency_table.rb
|
168
203
|
- lib/veye/project/project_json.rb
|
@@ -170,6 +205,7 @@ files:
|
|
170
205
|
- lib/veye/project/project_licence_json.rb
|
171
206
|
- lib/veye/project/project_licence_pretty.rb
|
172
207
|
- lib/veye/project/project_licence_table.rb
|
208
|
+
- lib/veye/project/project_markdown.rb
|
173
209
|
- lib/veye/project/project_pretty.rb
|
174
210
|
- lib/veye/project/project_table.rb
|
175
211
|
- lib/veye/project.rb
|
@@ -186,8 +222,10 @@ files:
|
|
186
222
|
- lib/veye/user.rb
|
187
223
|
- lib/veye/version.rb
|
188
224
|
- bin/veye
|
225
|
+
- DEPENDENCIES.md
|
189
226
|
- Gemfile
|
190
227
|
- Gemfile.lock
|
228
|
+
- Makefile
|
191
229
|
- README.md
|
192
230
|
- README.rdoc
|
193
231
|
- Rakefile
|
@@ -199,7 +237,6 @@ files:
|
|
199
237
|
homepage: https://github.com/versioneye/veye
|
200
238
|
licenses:
|
201
239
|
- MIT
|
202
|
-
metadata: {}
|
203
240
|
post_install_message: ! 'Thanks for installing! To get more info, use: veye help'
|
204
241
|
rdoc_options:
|
205
242
|
- --title
|
@@ -211,19 +248,21 @@ require_paths:
|
|
211
248
|
- lib
|
212
249
|
- lib
|
213
250
|
required_ruby_version: !ruby/object:Gem::Requirement
|
251
|
+
none: false
|
214
252
|
requirements:
|
215
253
|
- - ! '>='
|
216
254
|
- !ruby/object:Gem::Version
|
217
255
|
version: '0'
|
218
256
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
|
+
none: false
|
219
258
|
requirements:
|
220
259
|
- - ! '>='
|
221
260
|
- !ruby/object:Gem::Version
|
222
261
|
version: '0'
|
223
262
|
requirements: []
|
224
263
|
rubyforge_project:
|
225
|
-
rubygems_version:
|
264
|
+
rubygems_version: 1.8.26
|
226
265
|
signing_key:
|
227
|
-
specification_version:
|
266
|
+
specification_version: 3
|
228
267
|
summary: Commandline tool for VersionEye
|
229
268
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
NjVhZDVmMTViZDZmNmJiYmE1NDViOTAzMDVlZDBkMDBiYjgzNTBlYg==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NTQxY2RmMmM0NGYxYmEwNDgyOWJmZTg5OWEwNjEwZTRhMTZjZGQxOA==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YWM2MzJjZWVlYjJlZmU2NzdlZTNhMDE3MzdlMjE2ZjU4YWQ2M2E5Y2VmN2Vl
|
10
|
-
OTQzMTBhYTU4YWE5YTRiMWJhNjEzZDg4YTM1YjlkMjE4MTYzMDNlZWFlYjFi
|
11
|
-
MTBiMjA5ODc0NjNiNmRlMGQ4MjhlNzU2MDc3YzFmOGE1MjJhYTE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YWI4ZjE4OTI1NThmY2ZlZjA4ZjM4MWQwMWMzMDRkNjNlMWViZDUxMTgxZmZk
|
14
|
-
NjcxZWRkM2RiOTJhYzBkZmU0MzhjY2VjYWMxZTFmNGUxNGMwZmI5YmU1ODhk
|
15
|
-
ZTQ4OTMwOTUzNDc0OTdhYWIyMDJjYjBhYTBiZjY4NTIzYzkwNjA=
|