packagecloud-ruby 0.2.16 → 0.2.17

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
  SHA1:
3
- metadata.gz: 7499f7471cde932e1a36adfcc98484b4e432883f
4
- data.tar.gz: ba375fde7e831a512dfb0166ff9ef534226ac235
3
+ metadata.gz: 4e8f650dbc96aa88992fc0dda27623c8719d18c7
4
+ data.tar.gz: ef502f707b27a9a07f2530fb8e2deb41c3bc00f7
5
5
  SHA512:
6
- metadata.gz: 84c78d28a23fada009a81f27aca356e532d2771ee5aa2430a4edfc81b9c8a2232b928ca9a9a5cb3c0846739236a1cc14d3d4b7cff03e8cd45d1fbfd4437671c9
7
- data.tar.gz: 3cad35c0bd37c2b69dd70f47013c78b74c392784901427f2fa768ff0a322798d2544ec5b69854820f079b9a0009eb42b3b4e15b4ad74b8ae8814488ce11433e4
6
+ metadata.gz: d02c15ff34c1d54263bb1fc52acddb1a05f09694eb175076e218e35f5051410b4939f48f20adf5748cd3266f38dbc1369764994ec168514288e8674950ef902b
7
+ data.tar.gz: 4eafaf179abc1380cf65756f3a2b1ac853c3f4d2d497ba42be3109405fba18d82015bf01fc18e1fb9f667a8a624656a49a5e086ea3ee1dd1ca1322e447615f36
data/.yardopts CHANGED
@@ -1 +1 @@
1
- --markup rdoc --title "libpcloud Documentation" --protected
1
+ --markup rdoc --title "packagecloud-ruby Documentation" --protected
data/Gemfile CHANGED
@@ -1,7 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'excon'
4
- gem 'json_pure'
5
- gem 'mime'
6
-
7
3
  gemspec
data/README.md ADDED
@@ -0,0 +1,101 @@
1
+ ## packagecloud-ruby
2
+
3
+ Ruby library for communicating with the [packagecloud.io](https://packagecloud.io) API.
4
+
5
+ * [Homepage](https://rubygems.org/gems/packagecloud-ruby)
6
+ * [Documentation](http://rubydoc.info/gems/packagecloud-ruby/frames)
7
+ * [Email](mailto:support@packagecloud.io)
8
+
9
+
10
+ ## Implemented API Endpoints
11
+
12
+ * [Get Package Contents](https://packagecloud.io/docs/api#resource_packages_method_contents)
13
+ * [Upload Package](https://packagecloud.io/docs/api#resource_packages_method_create)
14
+ * [List Distributions](https://packagecloud.io/docs/api#resource_distributions_method_index)
15
+ * [View Repository](https://packagecloud.io/docs/api#resource_repositories_method_show)
16
+ * [View Repositories](https://packagecloud.io/docs/api#resource_repositories_method_index)
17
+ * [Create Repository](https://packagecloud.io/docs/api#resource_repositories_method_create)
18
+
19
+ ## Installation
20
+
21
+ ```
22
+ gem install packagecloud-ruby
23
+ ```
24
+
25
+ ## Creating a Client
26
+
27
+ ```ruby
28
+ require 'packagecloud'
29
+
30
+ # Create a client
31
+ credentials = Packagecloud::Credentials.new("joedamato", "test_token")
32
+ @client = Packagecloud::Client.new(credentials)
33
+
34
+ ```
35
+
36
+ ## Result objects
37
+
38
+ Every client API method call returns a ```Result``` object, which is simply:
39
+
40
+ ```ruby
41
+ module Packagecloud
42
+ class Result
43
+ attr_accessor :response
44
+ attr_accessor :succeeded
45
+ end
46
+ end
47
+ ```
48
+
49
+ If ```.succeeded``` is ```true``` then, ```.response``` is the parsed JSON response
50
+ of that endpoint, otherwise ```.response``` is the error text explaining what went wrong.
51
+
52
+
53
+ ## Usage
54
+
55
+ ### Distributions
56
+
57
+ ```ruby
58
+ # Get all distributions
59
+ distros = @client.distributions
60
+
61
+ # Looking up a distribution id by name
62
+ id = @client.find_distribution_id("centos/6") # returns 12
63
+ ```
64
+
65
+ ### Repositories
66
+
67
+ ```ruby
68
+ # Looking up all repositories available for a client
69
+ repos = @client.repositories
70
+
71
+ # Lookup info on a single repo
72
+ repo = @client.repository("my_repo")
73
+
74
+ # Creating a repository
75
+ @client.create_repository("my_repo")
76
+
77
+ ```
78
+
79
+ ### Packages
80
+
81
+ ```ruby
82
+ # Create Packages (takes IO object for file)
83
+ gem_package = Package.new(open("rails-4.0.0.gem"))
84
+ rpm_package = Package.new(open("libcurl-0.1.2.rpm"), 12) # 12 being the distribution id for centos/6, for example
85
+
86
+ # Creating source Packages
87
+ source_files = { "jake_1.0.orig.tar.bz2" => open("/path/jake_1.0.orig.tar.bz2"),
88
+ "jake_1.0-7.debian.tar.gz" => open("/path/jake_1.0-7.debian.tar.gz") }
89
+ dsc_package = Package.new("jake_1.0-7.dsc", 20, source_files)
90
+
91
+ # Upload Packages
92
+ @client.put_package("test_repo", gem_package)
93
+ @client.put_package("test_repo", rpm_package)
94
+ @client.put_package("test_repo", dsc_package)
95
+ ```
96
+
97
+ ## Copyright
98
+
99
+ Copyright (c) 2014 Computology, LLC
100
+
101
+ See LICENSE.txt for details.
@@ -1,7 +1,7 @@
1
1
  module Packagecloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "2"
4
- PATCH_VERSION = "16"
4
+ PATCH_VERSION = "17"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
@@ -17,6 +17,10 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
19
 
20
+ gem.add_runtime_dependency 'excon', '~> 0.40'
21
+ gem.add_runtime_dependency 'json_pure', '~> 1'
22
+ gem.add_runtime_dependency 'mime', '~> 0.4'
23
+
20
24
  gem.add_development_dependency 'bundler', '~> 1.0'
21
25
  gem.add_development_dependency 'rake', '~> 0.8'
22
26
  gem.add_development_dependency 'rspec', '~> 2.4'
metadata CHANGED
@@ -1,15 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packagecloud-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Damato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-08 00:00:00.000000000 Z
11
+ date: 2015-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: excon
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.40'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.40'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json_pure
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mime
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.4'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.4'
13
55
  - !ruby/object:Gem::Dependency
14
56
  name: bundler
15
57
  requirement: !ruby/object:Gem::Requirement
@@ -104,10 +146,9 @@ files:
104
146
  - ".gitignore"
105
147
  - ".rspec"
106
148
  - ".yardopts"
107
- - ChangeLog.rdoc
108
149
  - Gemfile
109
150
  - LICENSE.txt
110
- - README.rdoc
151
+ - README.md
111
152
  - Rakefile
112
153
  - lib/packagecloud.rb
113
154
  - lib/packagecloud/client.rb
data/ChangeLog.rdoc DELETED
@@ -1,4 +0,0 @@
1
- === 0.1.0 / 2014-11-11
2
-
3
- * Initial release:
4
-
data/README.rdoc DELETED
@@ -1,64 +0,0 @@
1
- = libpcloud
2
-
3
- * {Homepage}[https://rubygems.org/gems/libpcloud]
4
- * {Documentation}[http://rubydoc.info/gems/libpcloud/frames]
5
- * {Email}[mailto:support@packagecloud.io]
6
-
7
- == Description
8
-
9
- Ruby library for communicating with the {packagecloud.io}[https://packagecloud.io] API.
10
-
11
- == Features
12
-
13
- Implemented:
14
-
15
- * {Get Package Contents}[https://packagecloud.io/docs/api#resource_packages_method_contents]
16
- * {Create Package}[https://packagecloud.io/docs/api#resource_packages_method_create]
17
- * {List distributions}[https://packagecloud.io/docs/api#resource_distributions_method_index]
18
-
19
- == Usage
20
-
21
- require 'packagecloud'
22
-
23
- # Create a client
24
- credentials = Credentials.new("joedamato", "test_token")
25
- @client = PackageCloud.new(credentials)
26
-
27
- # Get distributions
28
- distros = @client.distributions
29
-
30
- # Looking up a distribution id by name
31
- id = @client.find_distribution_id("centos/6") # returns 12
32
-
33
- # Looking up all repositories available for a client
34
- repos = @client.repositories
35
-
36
- # Lookup info on a single repo
37
- repo = @client.repository("my_repo")
38
-
39
- # Creating a repository
40
- @client.create_repository("my_repo")
41
-
42
- # Create Packages (takes IO object for file)
43
- gem_package = Package.new(open("rails-4.0.0.gem"))
44
- rpm_package = Package.new(open("libcurl-0.1.2.rpm"), 12) # 12 being the distribution id for centos/6, for example
45
-
46
- # Creating source Packages
47
- source_files = { "jake_1.0.orig.tar.bz2" => open("/path/jake_1.0.orig.tar.bz2"),
48
- "jake_1.0-7.debian.tar.gz" => open("/path/jake_1.0-7.debian.tar.gz") }
49
- dsc_package = Package.new("jake_1.0-7.dsc", 20, source_files)
50
-
51
- # Upload Packages
52
- @client.put_package("test_repo", gem_package)
53
- @client.put_package("test_repo", rpm_package)
54
- @client.put_package("test_repo", dsc_package)
55
-
56
- == Install
57
-
58
- $ gem install libpcloud
59
-
60
- == Copyright
61
-
62
- Copyright (c) 2014 Computology, LLC
63
-
64
- See LICENSE.txt for details.