veye 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +48 -41
  3. data/README.md +36 -17
  4. data/bin/veye +176 -47
  5. data/bundle +0 -0
  6. data/changelogs.md +19 -0
  7. data/lib/veye/api/package.rb +16 -2
  8. data/lib/veye/api/project.rb +41 -6
  9. data/lib/veye/base_executor.rb +81 -16
  10. data/lib/veye/github/delete.rb +2 -4
  11. data/lib/veye/github/import.rb +3 -4
  12. data/lib/veye/package/follow.rb +9 -9
  13. data/lib/veye/package/info.rb +4 -4
  14. data/lib/veye/package/references.rb +4 -6
  15. data/lib/veye/package/search.rb +2 -1
  16. data/lib/veye/package/versions.rb +37 -0
  17. data/lib/veye/package.rb +2 -0
  18. data/lib/veye/project/check.rb +19 -9
  19. data/lib/veye/project.rb +86 -2
  20. data/lib/veye/version.rb +1 -1
  21. data/lib/veye/views/base_csv.rb +1 -1
  22. data/lib/veye/views/github/info_csv.rb +1 -1
  23. data/lib/veye/views/github/info_pretty.rb +1 -1
  24. data/lib/veye/views/github/info_table.rb +2 -2
  25. data/lib/veye/views/package/info_csv.rb +4 -3
  26. data/lib/veye/views/package/info_pretty.rb +4 -2
  27. data/lib/veye/views/package/info_table.rb +4 -1
  28. data/lib/veye/views/package/versions_csv.rb +24 -0
  29. data/lib/veye/views/package/versions_json.rb +15 -0
  30. data/lib/veye/views/package/versions_pretty.rb +23 -0
  31. data/lib/veye/views/package/versions_table.rb +27 -0
  32. data/lib/veye/views/package.rb +4 -0
  33. data/lib/veye/views/project/dependency_csv.rb +18 -10
  34. data/lib/veye/views/project/dependency_pretty.rb +13 -2
  35. data/lib/veye/views/project/dependency_table.rb +8 -2
  36. data/lib/veye/views/project/info_csv.rb +9 -3
  37. data/lib/veye/views/project/info_markdown.rb +7 -2
  38. data/lib/veye/views/project/info_pretty.rb +6 -1
  39. data/lib/veye/views/project/info_table.rb +8 -3
  40. data/lib/veye.rb +26 -3
  41. data/test/api/package_test.rb +15 -0
  42. data/test/api/project_test.rb +83 -19
  43. data/test/base/base_executor_test.rb +87 -0
  44. data/test/fixtures/vcr_cassettes/github_delete.yml +7 -7
  45. data/test/fixtures/vcr_cassettes/github_import.yml +11 -13
  46. data/test/fixtures/vcr_cassettes/github_info.yml +10 -10
  47. data/test/fixtures/vcr_cassettes/github_list.yml +12 -12
  48. data/test/fixtures/vcr_cassettes/github_sync.yml +7 -7
  49. data/test/fixtures/vcr_cassettes/package_follow.yml +10 -10
  50. data/test/fixtures/vcr_cassettes/package_follow_status.yml +7 -7
  51. data/test/fixtures/vcr_cassettes/package_info.yml +17 -18
  52. data/test/fixtures/vcr_cassettes/package_info_default.yml +54 -0
  53. data/test/fixtures/vcr_cassettes/package_info_versioned.yml +54 -0
  54. data/test/fixtures/vcr_cassettes/package_reference.yml +8 -8
  55. data/test/fixtures/vcr_cassettes/package_search.yml +8 -8
  56. data/test/fixtures/vcr_cassettes/package_unfollow.yml +7 -7
  57. data/test/fixtures/vcr_cassettes/package_versions.yml +44 -0
  58. data/test/fixtures/vcr_cassettes/project_check_new.yml +33 -30
  59. data/test/fixtures/vcr_cassettes/project_check_update.yml +29 -30
  60. data/test/fixtures/vcr_cassettes/project_delete.yml +8 -8
  61. data/test/fixtures/vcr_cassettes/project_delete_for_licenses.yml +48 -0
  62. data/test/fixtures/vcr_cassettes/project_delete_for_update.yml +46 -0
  63. data/test/fixtures/vcr_cassettes/project_delete_merge_child.yml +46 -0
  64. data/test/fixtures/vcr_cassettes/project_delete_merge_parent.yml +46 -0
  65. data/test/fixtures/vcr_cassettes/project_get.yml +11 -12
  66. data/test/fixtures/vcr_cassettes/project_license.yml +11 -12
  67. data/test/fixtures/vcr_cassettes/project_license_command.yml +49 -0
  68. data/test/fixtures/vcr_cassettes/project_list.yml +14 -14
  69. data/test/fixtures/vcr_cassettes/project_merge.yml +46 -0
  70. data/test/fixtures/vcr_cassettes/project_unmerge.yml +46 -0
  71. data/test/fixtures/vcr_cassettes/project_update.yml +15 -16
  72. data/test/fixtures/vcr_cassettes/project_upload.yml +17 -16
  73. data/test/fixtures/vcr_cassettes/project_upload_for_licenses.yml +107 -0
  74. data/test/fixtures/vcr_cassettes/project_upload_for_update.yml +105 -0
  75. data/test/fixtures/vcr_cassettes/project_upload_merge_child.yml +65 -0
  76. data/test/fixtures/vcr_cassettes/project_upload_merge_parent.yml +104 -0
  77. data/test/fixtures/vcr_cassettes/project_upload_with_args.yml +106 -0
  78. data/test/fixtures/vcr_cassettes/services_ping.yml +6 -8
  79. data/test/fixtures/vcr_cassettes/user_get_favorites.yml +10 -10
  80. data/test/fixtures/vcr_cassettes/user_get_profile.yml +10 -10
  81. data/test/github_delete_test.rb +5 -3
  82. data/test/github_import_test.rb +8 -15
  83. data/test/github_info_test.rb +2 -2
  84. data/test/package_follow_test.rb +3 -3
  85. data/test/package_info_test.rb +16 -15
  86. data/test/package_reference_test.rb +4 -4
  87. data/test/package_search_test.rb +4 -4
  88. data/test/package_versions_test.rb +73 -0
  89. data/test/project_check_test.rb +107 -79
  90. data/test/project_license_test.rb +29 -11
  91. data/test/project_test.rb +59 -0
  92. data/test/user_me_test.rb +4 -4
  93. data/veye.gemspec +10 -8
  94. data/veye.log +11 -0
  95. metadata +73 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a74c78261e96d683320361d39757d8b442ebb908
4
- data.tar.gz: 539d5b1772f5e24186b0e7d3930ed377437dc911
3
+ metadata.gz: af2527fb1d10ea94e7076697eff2ae12019d70cd
4
+ data.tar.gz: d8a973aee8d94fe95642949e441804cf205ce82c
5
5
  SHA512:
6
- metadata.gz: 8c9b0f5de78f5735dd22f3007e70a1bcd5d6ae0d151b8aa961c724c217160442a6472e4e790bbfa60675c11970dd32a5383f154d11094df97968bd0d05bbd530
7
- data.tar.gz: aa170517ffa5ea1fd4d761cee3b376816050ba1bcd000c16af33f504b7feebcc5c72cfda6c803da821a84ba346a5198ae625327576d5a7921165305432daeeca
6
+ metadata.gz: 2d67a65cdcc2584150de45e9500fda3a713563937ccacf2ccf5b33b12c7ee6bf61338473d949bd526b3383d053fc2eba474fee7908c41ee3b015a84c81b5ace4
7
+ data.tar.gz: a710c2cc3fe7dea6c296d73edae1efd2f60197f0362bd0c5dfd6a9d26b3630c7dd619dbf04ebf67fad94cf7b74ab1c221f77479ee1d2b25bea39222b32666a80
data/Gemfile.lock CHANGED
@@ -1,97 +1,104 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- veye (0.2.1)
5
- awesome_print (~> 1.6)
6
- gli (= 2.13.4)
4
+ veye (0.3.0)
5
+ awesome_print (~> 1.7)
6
+ gli (~> 2.14)
7
+ naturalsorter (~> 3.0)
7
8
  rainbow (~> 2.0)
8
9
  render-as-markdown (~> 0)
9
- rest-client (~> 1.8)
10
- terminal-table (~> 1.4)
10
+ rest-client (~> 2.0)
11
+ semverly (~> 1.0)
12
+ terminal-table (~> 1.7)
11
13
 
12
14
  GEM
13
15
  remote: https://rubygems.org/
14
16
  specs:
15
17
  addressable (2.4.0)
16
18
  ansi (1.5.0)
17
- aruba (0.14.0)
19
+ aruba (0.14.2)
18
20
  childprocess (~> 0.5.6)
19
21
  contracts (~> 0.9)
20
22
  cucumber (>= 1.3.19)
21
23
  ffi (~> 1.9.10)
22
24
  rspec-expectations (>= 2.99)
23
25
  thor (~> 0.19)
24
- ast (2.2.0)
25
- awesome_print (1.6.1)
26
+ ast (2.3.0)
27
+ awesome_print (1.7.0)
26
28
  builder (3.2.2)
27
29
  childprocess (0.5.9)
28
30
  ffi (~> 1.0, >= 1.0.11)
29
- contracts (0.13.0)
31
+ contracts (0.14.0)
30
32
  crack (0.4.3)
31
33
  safe_yaml (~> 1.0.0)
32
- cucumber (2.3.2)
34
+ cucumber (2.4.0)
33
35
  builder (>= 2.1.2)
34
- cucumber-core (~> 1.4.0)
36
+ cucumber-core (~> 1.5.0)
35
37
  cucumber-wire (~> 0.0.1)
36
38
  diff-lcs (>= 1.1.3)
37
- gherkin (~> 3.2.0)
39
+ gherkin (~> 4.0)
38
40
  multi_json (>= 1.7.5, < 2.0)
39
41
  multi_test (>= 0.1.2)
40
- cucumber-core (1.4.0)
41
- gherkin (~> 3.2.0)
42
+ cucumber-core (1.5.0)
43
+ gherkin (~> 4.0)
42
44
  cucumber-wire (0.0.1)
43
45
  diff-lcs (1.2.5)
44
- domain_name (0.5.20160309)
46
+ domain_name (0.5.20160826)
45
47
  unf (>= 0.0.5, < 1.0.0)
46
- ffi (1.9.10)
47
- gherkin (3.2.0)
48
- gli (2.13.4)
48
+ ffi (1.9.14)
49
+ gherkin (4.0.0)
50
+ gli (2.14.0)
49
51
  hashdiff (0.3.0)
50
52
  http-cookie (1.0.2)
51
53
  domain_name (~> 0.5)
52
54
  json (1.8.3)
53
- mime-types (2.99.1)
54
- minitest (5.8.4)
55
- minitest-reporters (1.1.8)
55
+ mime-types (3.1)
56
+ mime-types-data (~> 3.2015)
57
+ mime-types-data (3.2016.0521)
58
+ minitest (5.9.0)
59
+ minitest-reporters (1.1.11)
56
60
  ansi
57
61
  builder
58
62
  minitest (>= 5.0)
59
63
  ruby-progressbar
60
- multi_json (1.11.2)
64
+ multi_json (1.12.1)
61
65
  multi_test (0.1.2)
66
+ naturalsorter (3.0.14)
62
67
  netrc (0.11.0)
63
- parser (2.3.0.6)
68
+ parser (2.3.1.2)
64
69
  ast (~> 2.2)
65
70
  powerpack (0.1.1)
66
71
  rainbow (2.1.0)
67
- rake (11.1.1)
72
+ rake (11.2.2)
68
73
  rdoc (4.2.2)
69
74
  json (~> 1.4)
70
75
  render-as-markdown (0.0.6)
71
- rest-client (1.8.0)
76
+ rest-client (2.0.0)
72
77
  http-cookie (>= 1.0.2, < 2.0)
73
- mime-types (>= 1.16, < 3.0)
74
- netrc (~> 0.7)
75
- rspec-expectations (3.4.0)
78
+ mime-types (>= 1.16, < 4.0)
79
+ netrc (~> 0.8)
80
+ rspec-expectations (3.5.0)
76
81
  diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.4.0)
78
- rspec-support (3.4.1)
79
- rubocop (0.38.0)
80
- parser (>= 2.3.0.6, < 3.0)
82
+ rspec-support (~> 3.5.0)
83
+ rspec-support (3.5.0)
84
+ rubocop (0.42.0)
85
+ parser (>= 2.3.1.1, < 3.0)
81
86
  powerpack (~> 0.1)
82
87
  rainbow (>= 1.99.1, < 3.0)
83
88
  ruby-progressbar (~> 1.7)
84
89
  unicode-display_width (~> 1.0, >= 1.0.1)
85
- ruby-progressbar (1.7.5)
90
+ ruby-progressbar (1.8.1)
86
91
  safe_yaml (1.0.4)
87
- terminal-table (1.5.2)
92
+ semverly (1.0.0)
93
+ terminal-table (1.7.0)
94
+ unicode-display_width (~> 1.1)
88
95
  thor (0.19.1)
89
96
  unf (0.1.4)
90
97
  unf_ext
91
98
  unf_ext (0.0.7.2)
92
- unicode-display_width (1.0.2)
93
- vcr (3.0.1)
94
- webmock (1.24.2)
99
+ unicode-display_width (1.1.0)
100
+ vcr (3.0.3)
101
+ webmock (2.1.0)
95
102
  addressable (>= 2.3.6)
96
103
  crack (>= 0.3.2)
97
104
  hashdiff
@@ -101,14 +108,14 @@ PLATFORMS
101
108
 
102
109
  DEPENDENCIES
103
110
  aruba (~> 0.14)
104
- minitest (~> 5.8)
105
- minitest-reporters (~> 1.0)
111
+ minitest (~> 5.9)
112
+ minitest-reporters (~> 1.1)
106
113
  rake (~> 11.1)
107
114
  rdoc (~> 4.2)
108
115
  rubocop (~> 0.38)
109
- vcr (~> 3.0.1)
116
+ vcr (~> 3.0)
110
117
  veye!
111
- webmock (~> 1.11)
118
+ webmock (~> 2.1)
112
119
 
113
120
  BUNDLED WITH
114
121
  1.10.5
data/README.md CHANGED
@@ -1,30 +1,34 @@
1
1
  # Veye
2
2
 
3
- [![Dependency Status](https://www.versioneye.com/ruby/veye/0.1/badge.svg)](https://www.versioneye.com/ruby/veye/0.1)
4
- [![Join the chat at https://gitter.im/versioneye/veye](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/versioneye/veye?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3
+ [![Dependency Status](https://www.versioneye.com/user/projects/57c995a4968d640049e12849/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/57c995a4968d640049e12849)[![Join the chat at https://gitter.im/versioneye/veye](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/versioneye/veye?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
4
 
6
5
 
7
- **veye** is a command line tool for [VersionEye](https://www.versioneye.com/). It is a wrapper around the [VersionEye API](https://www.versioneye.com/api), implemented in Ruby. The tool allows you to write scripts for continuous updating and due diligence.
6
+ **veye** is a command line tool and Ruby client for [VersionEye](https://www.versioneye.com/). The tool allows you to write scripts for continuous updating and due diligence tasks.
8
7
 
9
- Most endpoints require an API key, which you can get [here](https://www.versioneye.com/settings/api).
8
+ Most endpoints require an API key, which you can get [here](https://www.versioneye.com/settings/api) and i recommend you to use an organization API-key.
10
9
 
11
10
  [VersionEye](https://www.versioneye.com/) is a cross-platform search engine and crowdsourcing app for opensource software libraries.
12
11
 
13
12
  * Take advantage of the extended search to find any library you look for.
14
13
  * Follow and track your favorite software packages via RSS feed.
15
- * Leave comments and add additional meta information to the libraries to improve the quality of the data.
14
+ * Keep eye out-dated packages.
16
15
  * Contribute to this crowdsourcing project to make the world a better place for software developers.
17
16
 
18
- ![Main help](http://dl.dropbox.com/u/19578784/versioneye/cli_start_page.png)
17
+ ![Main help](http://g.recordit.co/4Mb8lBYwfG.gif)
19
18
 
20
19
 
21
- ## Install via RubyGems
20
+ ## Getting started with RubyGems
22
21
 
23
22
  ```
24
23
  $> gem install veye
24
+ $> veye
25
+ $> veye initconfig
26
+ $> veye change_key a124423233
25
27
  ```
26
28
 
27
- ## Install from source
29
+ More commands are in [Veye/CLI wiki](https://github.com/versioneye/veye/wiki), but i recommend to consult with [bin/veye](https://github.com/versioneye/veye/blob/master/bin/veye) file as not all the attributes and commandline flags are not documented.
30
+
31
+ ## Getting started for developers
28
32
 
29
33
  ###### Download source
30
34
 
@@ -33,7 +37,7 @@ Most endpoints require an API key, which you can get [here](https://www.versione
33
37
  $> cd veye
34
38
  ```
35
39
 
36
- ###### Run without installing
40
+ ###### Execute the CLI-tool without installing
37
41
  ```
38
42
  $> bundle
39
43
  $> bundle exec bin/veye ping
@@ -46,10 +50,24 @@ Most endpoints require an API key, which you can get [here](https://www.versione
46
50
  $> veye help
47
51
  $> veye ping
48
52
  ```
53
+
54
+ #### With docker
55
+ It ables to try different version of Rubies, without going to through big install-festival.
56
+
57
+
58
+ ```
59
+ $> make build
60
+ $> docker run -it --rm -v "$PWD:/usr/src/veye" ruby:2.3 /bin/sh
61
+ $> cd /usr/src/veye
62
+ $> gem install veye.gem
63
+ $> veye
64
+ ```
49
65
 
50
66
  ## Initial configuration
51
67
 
52
- The tool will raise an exception if the configuration file is missing. Veye needs a configuration file to keep the user specific settings and the API Key.
68
+ If you see the `cant find configfile` error after installing the Veye gem then this means the configuration file is missing and it must be created before it can run any commands.
69
+
70
+ The Veye uses the configuration file to keep settings and your API Key.
53
71
 
54
72
  #### create config file
55
73
 
@@ -82,11 +100,13 @@ $> veye search json --lang=r,php --page=2
82
100
 
83
101
  #you can cancel pagination with --no-pagination argument
84
102
  $> veye search junit --page 3 --no-pagination
103
+
104
+ $> veye info --language=PHP --version='3.0.1' symfony/symfony --format=table
85
105
  ```
86
106
 
87
107
  ## Output formats
88
108
 
89
- All commands support format-flag, that allows you change output format.
109
+ All commands support output format flag, that allows you change layout between human friendly display and machine readable formats.
90
110
 
91
111
  #### pretty print
92
112
 
@@ -121,8 +141,7 @@ It's designed after other ruby command-line tools.
121
141
  ![Json format](http://dl.dropbox.com/u/19578784/versioneye/search_json.png)
122
142
 
123
143
  #### Table view
124
- It's shows results as one Excel sheet - title and content.
125
- A Tabular view is best suited for bigger screens.
144
+ It's shows results as a big Excel sheet and works best on bigger screens.
126
145
 
127
146
  ```bash
128
147
  $> veye search json --format=table
@@ -187,7 +206,7 @@ There may be a situation when you need to update/re-write saved config file. The
187
206
 
188
207
  ## Contributing
189
208
 
190
- All contributions are welcome - comments, new ideas, help with documentation & help with features;
209
+ All contributions are welcome - comments, new ideas, **help with documentation** & help with features;
191
210
 
192
211
  #### Running tests
193
212
 
@@ -204,14 +223,14 @@ $> rake test TEST=test/file_you_changed.rb
204
223
  $> rubocop lib/your_file.rb
205
224
  ```
206
225
 
207
- ## Furhter documentation
226
+ ## Further documentation
208
227
 
209
- More documentation can be found in the [wiki](https://github.com/versioneye/veye/wiki).
228
+ More documentation can be found in the [Veye wiki](https://github.com/versioneye/veye/wiki).
210
229
 
211
230
  ## License
212
231
  The MIT License (MIT)
213
232
 
214
- Copyright (c)2015 **VersionEye GmbH**
233
+ Copyright: (c) 2016 **VersionEye GmbH**
215
234
 
216
235
 
217
236
  [MIT licence](http://choosealicense.com/licenses/mit/)
data/bin/veye CHANGED
@@ -44,6 +44,9 @@ flag :timeout, :default_value => 180
44
44
  desc 'force open timeout (in seconds)'
45
45
  flag :open_timeout, :default_value => 20
46
46
 
47
+ desc 'set log level'
48
+ flag :log_level, :default_value => 'debug'
49
+
47
50
  pre do |global_options, command, args|
48
51
  check_config_file
49
52
  $global_options = init_environment
@@ -78,7 +81,7 @@ command :search do |c|
78
81
  c.flag [:l, :language, 'language-name']
79
82
 
80
83
  c.desc 'filter result by Maven specific GroupId'
81
- c.flag "group-id"
84
+ c.flag [:gid, "group-id"]
82
85
 
83
86
  c.desc "get next N results, by default it only return 30 results."
84
87
  c.flag [:page, 'page-number'], :default_value => 1
@@ -93,58 +96,48 @@ command :search do |c|
93
96
  c.action do |global_options, options, args|
94
97
  error_msg = "the search term is mandatory.".color(:red)
95
98
  help_now!(error_msg) if args.empty?
99
+
96
100
  api_key = global_options[:api_key]
97
101
  search_term = args.shift
98
102
  Veye::Package::Search.search(api_key, search_term, options)
99
103
  end
100
104
  end
101
105
 
102
- desc 'returns package information'
103
- arg_name 'product_key'
104
- command :info do |c|
105
- c.desc "change output format"
106
- c.flag [:format, 'format-name'], :default_value => 'pretty'
107
106
 
108
- c.action do |global_options, options, args|
109
- error_msg = Rainbow("package_key is missing").red
110
- help_now!(error_msg) if args.empty?
111
- api_key = global_options[:api_key]
112
- package_key = args.shift
113
- Veye::Package::Info.get_package(api_key, package_key, options)
114
- end
115
- end
107
+ desc 'analyzes given project file and returns version info'
108
+ arg_name 'product_file'
116
109
 
117
- desc 'check a references of package'
118
- arg_name 'product_key'
119
- command :references do |c|
110
+ command :check do |c|
120
111
  c.desc "change output format"
121
112
  c.flag [:format, 'format-name'], :default_value => 'pretty'
122
113
 
123
- c.desc "page number for pagination"
124
- c.flag [:page, 'page-number'], :default_value => 1
114
+ c.desc "filter by organisation name"
115
+ c.flag [:org, 'org-name'], :default_value => 'private'
125
116
 
126
- c.desc "show paging information"
127
- c.switch [:pagination, 'show-pagination'], :default_value => true,
128
- :negatable => true
117
+ c.desc 'filter by team name'
118
+ c.flag [:team, 'team-name']
129
119
 
120
+ c.desc 'add memorizable, meaningful project name'
121
+ c.flag [:name, 'project-name']
130
122
 
131
- c.action do |global_options, options, args|
132
- error_msg = Rainbow("package_key is missing").red
133
- help_now!(error_msg) if args.empty?
134
- package_key = args.shift
123
+ c.desc 'upload as public project'
124
+ c.switch [:public], :default_value => true, :negatable => true
135
125
 
136
- api_key = global_options[:api_key]
137
- Veye::Package::References.get_references(api_key, package_key, options)
138
- end
139
- end
126
+ c.desc 'mark it as temporary project when uploading a new project'
127
+ c.switch [:temp, :temporary], :default_value => false, :negatable => true
140
128
 
129
+ c.desc "show all dependencies"
130
+ c.switch [:all, 'show-all'], default_value: false
141
131
 
142
- desc 'analyzes given project file and returns version info'
143
- arg_name 'product_file'
132
+ c.desc 'show only dependencies which has major version difference'
133
+ c.switch [:major], :default_value => false, :negatable => true
134
+
135
+ c.desc 'show only dependencies which has minor version difference'
136
+ c.switch [:minor], :default_value => false, :negatable => true
137
+
138
+ c.desc 'show only dependencies which has patch version difference'
139
+ c.switch [:patch], :default_value => false, :negatable => true
144
140
 
145
- command :check do |c|
146
- c.desc "change output format"
147
- c.flag [:format, 'format-name'], :default_value => 'pretty'
148
141
 
149
142
  c.action do |global_options, options, args|
150
143
  file_path = args.shift
@@ -168,14 +161,39 @@ command :projects do |c|
168
161
  c.desc "change output format"
169
162
  c.flag [:format, 'format-name'], :default_value => 'pretty'
170
163
 
164
+ c.desc "filter by organisation name"
165
+ c.flag [:org, 'org-name'], :default_value => 'private'
166
+
167
+ c.desc 'filter by team name'
168
+ c.flag [:team, 'team-name']
169
+
170
+ c.desc 'add memorizable, meaningful project name'
171
+ c.flag [:name, 'project-name']
172
+
173
+ c.desc 'upload as public project'
174
+ c.switch [:public], :default_value => true, :negatable => true
175
+
176
+ c.desc 'mark it as temporary project when uploading a new project'
177
+ c.switch [:temp, :temporary], :default_value => false, :negatable => true
178
+
171
179
  c.desc "show all dependencies"
172
- c.flag [:all, 'show-all'], default_value: false
180
+ c.switch [:all, 'show-all'], default_value: false
181
+
182
+ c.desc 'show only dependencies which has major version difference'
183
+ c.switch [:major], :default_value => false, :negatable => true
184
+
185
+ c.desc 'show only dependencies which has minor version difference'
186
+ c.switch [:minor], :default_value => false, :negatable => true
187
+
188
+ c.desc 'show only dependencies which has patch version difference'
189
+ c.switch [:patch], :default_value => false, :negatable => true
173
190
 
174
191
  c.desc "show all projects"
175
192
  c.command :list do |list|
176
193
  list.action do |global_options, options, args|
177
194
  api_key = global_options[:api_key]
178
- Veye::Project::Check.get_list(api_key, options)
195
+
196
+ Veye::Project::Check.get_list(api_key, options[:org], options[:team], options)
179
197
  end
180
198
  end
181
199
 
@@ -198,7 +216,11 @@ command :projects do |c|
198
216
  help_now!("The filepath is missing.".color(:red)) if args.empty?
199
217
  filename = args.shift
200
218
  api_key = global_options[:api_key]
201
- Veye::Project::Check.upload(api_key, filename, options)
219
+ org_name = (options[:org] || 'private')
220
+ is_temp = (options[:temp] == true)
221
+ visibility = (options[:public] == false ? 'private' : 'public')
222
+
223
+ Veye::Project::Check.upload(api_key, filename, org_name, options[:team], is_temp, visibility, options)
202
224
  end
203
225
  end
204
226
 
@@ -226,6 +248,32 @@ command :projects do |c|
226
248
  end
227
249
  end
228
250
 
251
+ c.desc "merge child project with the parent project"
252
+ c.arg_name "parent_child_ids", multiple: true
253
+ c.command :merge do |merge|
254
+ merge.action do |global_options, options, args|
255
+ help_now!("You forgot to specify parent id and child project id".color(:red)) if args.empty?
256
+ help_now!("You forgot to specify child project id".color(:red)) if args.size == 1
257
+
258
+ parent_id, child_id = args
259
+ api_key = global_options[:api_key]
260
+ Veye::Project.merge(api_key, parent_id, child_id)
261
+ end
262
+ end
263
+
264
+ c.desc "unmerges child project from the parent project"
265
+ c.arg_name "parent_child_ids", multiple: true
266
+ c.command :unmerge do |unmerge|
267
+ unmerge.action do |global_options, options, args|
268
+ help_now!("You forgot to specify parent id and child project id".color(:red)) if args.empty?
269
+ help_now!("You forgot to specify child project id".color(:red)) if args.size == 1
270
+
271
+ parent_id, child_id = args
272
+ api_key = global_options[:api_key]
273
+ Veye::Project.unmerge(api_key, parent_id, child_id)
274
+ end
275
+ end
276
+
229
277
  c.desc "delete project"
230
278
  c.arg_name "project_key"
231
279
  c.command :delete do |delete|
@@ -239,18 +287,89 @@ command :projects do |c|
239
287
  end
240
288
 
241
289
  desc "package related methods"
242
- command :products do |c|
290
+ command :package do |c|
291
+ c.desc 'specify a language of the product'
292
+ c.flag [:l, :language, 'language-name']
293
+
243
294
  c.desc "change output format"
244
295
  c.flag [:format, 'format-name'], :default_value => 'pretty'
245
296
 
297
+ c.desc 'returns package information'
298
+ c.arg_name 'prod_key'
299
+ c.command :info do |csub|
300
+ csub.desc 'specify a version of the product'
301
+ csub.flag [:v, :version, 'version-id']
302
+
303
+ csub.action do |global_options, options, args|
304
+ error_msg = Rainbow("The package ID is unspecified").red
305
+ help_now!(error_msg) if args.empty?
306
+
307
+ error_msg = 'no language specified - use -l/--language/--language-name key'.color(:red)
308
+ help_now!(error_msg) if options[:language].nil?
309
+
310
+ api_key = global_options[:api_key]
311
+ package_key = args.shift
312
+ Veye::Package::Info.get_package(api_key, package_key, options[:language], options[:version], options)
313
+ end
314
+ end
315
+
316
+ c.desc 'check a references of package'
317
+ c.arg_name 'prod_key'
318
+ c.command :references do |csub|
319
+ csub.desc "page number for pagination"
320
+ csub.flag [:page, 'page-number'], :default_value => 1
321
+
322
+ csub.desc "show paging information"
323
+ csub.switch [:pagination, 'show-pagination'], :default_value => true, :negatable => true
324
+
325
+ csub.action do |global_options, options, args|
326
+ error_msg = Rainbow("The package ID is unspecified").red
327
+ help_now!(error_msg) if args.empty?
328
+ error_msg = 'no language specified - use -l/--language/--language-name key'.color(:red)
329
+ help_now!(error_msg) if options[:language].nil?
330
+
331
+ prod_key = args.shift
332
+ api_key = global_options[:api_key]
333
+ Veye::Package::References.get_references(api_key, prod_key, options[:language], options)
334
+ end
335
+ end
336
+
337
+ c.desc 'fetch list of versions'
338
+ c.arg_name 'prod_key'
339
+ c.command :versions do |csub|
340
+ csub.desc "number of versions to show"
341
+ csub.flag [:n, 'n-results'], :default_value => 10
342
+
343
+ csub.desc 'number of versions to skip'
344
+ csub.flag [:from], :default_value => 0
345
+
346
+ csub.desc 'show all the items'
347
+ csub.switch [:all, 'no-filtering'], :default_value => false
348
+
349
+ csub.action do |global_options, options, args|
350
+ help_now!("The product ID is unspecified".color(:red)) if args.empty?
351
+ error_msg = 'no language specified - use -l/--language/--language-name key'.color(:red)
352
+ help_now!(error_msg) if options[:language].nil?
353
+
354
+ prod_key = args.shift
355
+ api_key = global_options[:api_key]
356
+ Veye::Package::Versions.get_list(
357
+ api_key, prod_key, options[:language], options[:n].to_i, options[:from].to_i, options
358
+ )
359
+ end
360
+ end
361
+
246
362
  c.desc "check your following status"
247
363
  c.arg_name "prod_key"
248
364
  c.command :following do |following|
249
365
  following.action do |global_options, options, args|
250
- help_now!("Product's key is missing".color(:red)) if args.empty?
366
+ help_now!("The product ID is unspecified".color(:red)) if args.empty?
367
+ error_msg = 'no language specified - use -l/--language/--language-name key'.color(:red)
368
+ help_now!(error_msg) if options[:language].nil?
369
+
251
370
  prod_key = args.shift
252
371
  api_key = global_options[:api_key]
253
- Veye::Package::Follow.get_follow_status(api_key, prod_key)
372
+ Veye::Package::Follow.get_follow_status(api_key, prod_key, options[:language])
254
373
  end
255
374
  end
256
375
 
@@ -258,10 +377,13 @@ command :products do |c|
258
377
  c.arg_name "prod_key"
259
378
  c.command :follow do |follow|
260
379
  follow.action do |global_options, options, args|
261
- help_now!("Product's key is missing".color(:red)) if args.empty?
380
+ help_now!("The product ID is unspecified".color(:red)) if args.empty?
381
+ error_msg = 'no language specified - use -l/--language/--language-name key'.color(:red)
382
+ help_now!(error_msg) if options[:language].nil?
383
+
262
384
  prod_key = args.shift
263
385
  api_key = global_options[:api_key]
264
- Veye::Package::Follow.follow(api_key, prod_key)
386
+ Veye::Package::Follow.follow(api_key, prod_key, options[:language])
265
387
  end
266
388
  end
267
389
 
@@ -269,10 +391,13 @@ command :products do |c|
269
391
  c.arg_name "prod_key"
270
392
  c.command :unfollow do |unfollow|
271
393
  unfollow.action do |global_options, options, args|
272
- help_now!("Product's key is missing".color(:red)) if args.empty?
394
+ help_now!("The product ID is unspecified".color(:red)) if args.empty?
395
+ error_msg = 'no language specified - use -l/--language/--language-name key'.color(:red)
396
+ help_now!(error_msg) if options[:language].nil?
397
+
273
398
  prod_key = args.shift
274
399
  api_key = global_options[:api_key]
275
- Veye::Package::Follow.unfollow(api_key, prod_key)
400
+ Veye::Package::Follow.unfollow(api_key, prod_key, options[:language])
276
401
  end
277
402
  end
278
403
  end
@@ -326,7 +451,7 @@ command :github do |c|
326
451
  c.flag [:branch], :default_value => "master"
327
452
 
328
453
  c.desc "specify the name of the project file"
329
- c.flag [:file, 'file'], :default_value => nil
454
+ c.flag [:file, 'file', 'filename'], :default_value => nil
330
455
 
331
456
  c.action do |global_options, options, args|
332
457
  help_now!
@@ -378,7 +503,10 @@ command :github do |c|
378
503
  help_now!("the name of repository is mandatory".color(:red)) if args.empty?
379
504
  repo_name = args.shift
380
505
  api_key = global_options[:api_key]
381
- Veye::Github::Import.import_repo(api_key, repo_name, options)
506
+ branch = (options[:branch] || 'master')
507
+ filename = (options['file'] || 'Gemfile')
508
+
509
+ Veye::Github::Import.import_repo(api_key, repo_name, branch, filename, options)
382
510
  end
383
511
  end # end of import
384
512
 
@@ -389,6 +517,7 @@ command :github do |c|
389
517
  help_now!("the name of repository is mandatory".color(:red)) if args.empty?
390
518
  repo_name = args.shift
391
519
  api_key = global_options[:api_key]
520
+
392
521
  Veye::Github::Delete.delete_repo(api_key, repo_name, options)
393
522
  end
394
523
  end
data/bundle ADDED
File without changes
data/changelogs.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelogs
2
2
 
3
+
4
+ ## Next release
5
+
6
+ * add vulnerability field for product details [#6](https://github.com/versioneye/veye/issues/6)
7
+ * **BREAKING** - refactored the `veye info` command, which expect that a product language is explicitly specified with `--language` flag and allows,
8
+ new command looks like this now `bundle exec bin/veye info --language=PHP --version='3.0.1' symfony/symfony --format=table`
9
+ * **BREAKING** - renamed the `products` command to `package`
10
+ * **BREAKING** - moved `info` command under the `package` command
11
+ * **BREAKING** - refactored others subcommands of the `package` to match with the `info` command.
12
+ * **BREAKING** - project commands accept --all as flag, but not attribute with value
13
+ * add `--private` flag for the `project check` command, possible to mark project visibility when checking project file [#25](https://github.com/versioneye/veye/issues/25)
14
+ * add `--temp` flag for the the `project check` command, possible to create temporary projects;
15
+ * add `--all`, `--major`, `--minor`, `--patch` flag for all the __projects__ command, including the check command; those flags allow filter outdated dependencies by SemVer scopes; [#23](https://github.com/versioneye/veye/issues/23)
16
+ * project dependencies are now sorted by `upgrade_complexity_heuristics`, which heuristic metric that gives an rough estimation how difficult upgrading to a current version will be;
17
+ * all the output of `project` commands include now the `upgrade_complexity_heuristics`
18
+ * add `merge` and `unmerge` subcommands under the `projects` command, which allows to attach child project to the parent_project. [#30](https://github.com/versioneye/veye/issues/30)
19
+
20
+
21
+
3
22
  ## 0.2.1 - 2016-03-15
4
23
 
5
24
  * fix check command, it used old argument orders;