libraries_io 0.1.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d173a9971784964e6080c24fe77fdd6623cc6fab86996f69cbe6cde806d1fc3
4
- data.tar.gz: 398f84d91d8cbdd17f9e0235b5ab747f25f28a8baf2ef3a93ab32bd05dced668
3
+ metadata.gz: 369618cf0017eb828560898f4614cca56be49b731e337a2e0f80a6d3794f6957
4
+ data.tar.gz: e3bd788f279860d0137f171705999e0f4a131bafe1c5c4de05c9ba188115addf
5
5
  SHA512:
6
- metadata.gz: 1b8f2766e3a3122e0b58d0c18c7fdfb2985937ea6ce1a920eb55f5c90d81399379767ed282f45c04acd8e797c2973e7c397dde54b940ca28b4260ed905e55f33
7
- data.tar.gz: c146076ec7d9cf69db84f35e730023195632faee801db9eadda87360779bdb5efc6c5bbbe824c20a4943cbaeabdbd6e53e130acf4efb290dabeeb6cc6c0df88d
6
+ metadata.gz: d315dd7ea8370313fb17415d6cfd25e480ca0b5f1b0f9196f357adf54521f3303e8b8db552df6e3e26e53ad08f158cadee4b8192d68643bd1a937302b27287ee
7
+ data.tar.gz: 4a19f4bb7a59960a398a16153e44bdce17e5a39cb3afbe2307a7459dbddac3175d1f7220860291274420fe706f5d9afb55a68ee60b1c0d8479530f0b6b388a16
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- libraries_io (0.1.0)
4
+ libraries_io (0.9.0)
5
5
  tlaw
6
6
 
7
7
  GEM
@@ -12,7 +12,7 @@ GEM
12
12
  crack (0.4.3)
13
13
  safe_yaml (~> 1.0.0)
14
14
  diff-lcs (1.3)
15
- faraday (0.15.2)
15
+ faraday (0.15.3)
16
16
  multipart-post (>= 1.2, < 3)
17
17
  faraday_middleware (0.12.2)
18
18
  faraday (>= 0.7.4, < 1.0)
@@ -55,4 +55,4 @@ DEPENDENCIES
55
55
  vcr (~> 3.0)
56
56
 
57
57
  BUNDLED WITH
58
- 1.16.2
58
+ 1.16.5
data/README.md CHANGED
@@ -19,7 +19,7 @@ And then execute:
19
19
 
20
20
  $ bundle
21
21
 
22
- 2) Get an API key [from Libraries.io](https://libraries.io/account) and specify it either:
22
+ 2) Get an API key [from Libraries.io](https://libraries.io/account). [A section below](#api-key) lists the different way to specify it.
23
23
 
24
24
  ## Usage
25
25
 
@@ -98,6 +98,8 @@ All documented calls are implemented (except "subscriptions"):
98
98
  * [api.user(name, host: "github").repository_contributions](https://libraries.io/api#user-repository-contributions)
99
99
  * [api.user(name, host: "github").dependencies(platform: nil)](https://libraries.io/api#user-dependencies)
100
100
 
101
+ *Note*: All API endpoints accept parameters `page` and `per_page`.
102
+
101
103
  ### API Key
102
104
 
103
105
  You can specify the API key in various ways:
@@ -1,4 +1,5 @@
1
1
  require 'tlaw'
2
+ require_relative 'libraries_io/ext/tlaw'
2
3
 
3
4
  require_relative 'libraries_io/version'
4
5
  require_relative 'libraries_io/api'
@@ -9,9 +9,8 @@ class LibrariesIO::API < TLAW::API
9
9
  param :api_key,
10
10
  default: -> { LibrariesIO.api_key },
11
11
  desc: 'get your api key from your account page: https://libraries.io/account'
12
- param :page, desc: 'page (default 1)'
13
- param :per_page, desc: 'results per page (default is `30`, max is `100`)'
14
-
12
+ global :page, desc: 'page (default 1)'
13
+ global :per_page, desc: 'results per page (default is `30`, max is `100`)'
15
14
 
16
15
  endpoint :platforms do
17
16
  desc "Get a list of supported package managers"
@@ -19,7 +18,11 @@ class LibrariesIO::API < TLAW::API
19
18
  end
20
19
 
21
20
  namespace :platform, '/{platform_id}' do
21
+ param :platform_id, default: 'rubygems'
22
+
22
23
  namespace :project, '/{id}' do
24
+ param :id, required: true
25
+
23
26
  endpoint :info, '' do
24
27
  desc "Get information about a package and it's versions"
25
28
  end
@@ -0,0 +1,23 @@
1
+ module TLAW
2
+ class DSL::NamespaceWrapper
3
+ def self.globals
4
+ @@globals ||= []
5
+ end
6
+
7
+ def global(name, type = nil, **opts)
8
+ DSL::NamespaceWrapper.globals << [name, type, opts]
9
+ end
10
+
11
+ module GlobalAwareEndpoint
12
+ def endpoint(*args, &block)
13
+ super(*args) do
14
+ instance_eval(&block)
15
+ DSL::NamespaceWrapper.globals.each do |name, type, opts|
16
+ param(name, type, **opts)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ prepend GlobalAwareEndpoint
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module LibrariesIO
2
- VERSION = "0.1.0"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libraries_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-Andre Lafortune
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-14 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tlaw
@@ -116,6 +116,7 @@ files:
116
116
  - lib/libraries_io/aliases.rb
117
117
  - lib/libraries_io/api.rb
118
118
  - lib/libraries_io/doc.rb
119
+ - lib/libraries_io/ext/tlaw.rb
119
120
  - lib/libraries_io/version.rb
120
121
  - libraries_io.gemspec
121
122
  homepage: https://github.com/marcandre/libraries_io