jackie 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
- - rbx
7
- branches:
8
- only:
9
- - master
10
- matrix:
11
- include:
12
- - rvm: jruby
13
- env: JRUBY_OPTS="--1.9 --server -Xcext.enabled=true"
14
- - rvm: jruby-head
15
- env: JRUBY_OPTS="--1.9 --server -Xcext.enabled=true"
5
+ - rbx-19mode
6
+ - jruby-19mode
7
+ gemfile:
8
+ - test/gemfiles/Gemfile.ares-3.0.x
9
+ - test/gemfiles/Gemfile.ares-3.1.x
10
+ - test/gemfiles/Gemfile.ares-3.2.x
11
+ - test/gemfiles/Gemfile.ares-4.0.x
16
12
  before_script:
17
- - rake fake_s3
13
+ - rake fake_s3
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in jackie.gemspec
4
4
  gemspec
5
- gem 'aws-s3'
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Jackie
4
4
 
5
- A Ruby interface to the Kickfolio API.
5
+ A Ruby interface to the [App.io API](http://docs.app.io/api/).
6
6
 
7
7
  ## Installation
8
8
 
@@ -71,7 +71,7 @@ Jackie.configure_s3({
71
71
  version = Jackie::Version.new(:app_id => app.id, :file => "path/to/local/file.zip")
72
72
  version.save
73
73
  ```
74
- For additional information read the [Kickfolio API docs](https://github.com/Kickfolio/ApiDocs)
74
+ For additional information read the [App.io API docs](http://docs.app.io/api/)
75
75
 
76
76
  ## Contributing
77
77
 
@@ -84,5 +84,5 @@ For additional information read the [Kickfolio API docs](https://github.com/Kick
84
84
  License
85
85
  -------
86
86
 
87
- Jackie is Copyright © 2013 Firebase. It is free software,
87
+ Jackie is Copyright © 2013 HeapSource. It is free software,
88
88
  and may be redistributed under the terms specified in the LICENSE.txt file.
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jackie"
5
- spec.version = "0.1.2"
6
- spec.authors = ["Lacides Charris", "Guillermo Iguaran", "Roberto Miranda", "Firebase.co"]
7
- spec.email = ["lacides@firebase.co", "guille@firebase.co", "roberto@firebase.co", "hello@firebase.co"]
8
- spec.description = %q{A Ruby interface to the Kickfolio API.}
9
- spec.summary = %q{A Ruby interface to the Kickfolio API}
10
- spec.homepage = ""
5
+ spec.version = "0.2.0"
6
+ spec.authors = ["Lacides Charris", "Guillermo Iguaran", "Roberto Miranda", "HeapSource"]
7
+ spec.email = ["lacides@heapsource.com", "guille@heapsource.com", "roberto@heapsource.com", "hello@firebase.co"]
8
+ spec.description = %q{A Ruby interface to the App.io API.}
9
+ spec.summary = %q{A Ruby interface to the App.io API}
10
+ spec.homepage = "https://github.com/heapsource/jackie"
11
11
  spec.license = "MIT"
12
12
 
13
13
  spec.files = `git ls-files`.split($/)
@@ -16,8 +16,9 @@ Gem::Specification.new do |spec|
16
16
  spec.require_paths = ["lib"]
17
17
 
18
18
  spec.add_development_dependency "rake"
19
- spec.add_development_dependency "minitest"
19
+ spec.add_development_dependency "minitest", "~> 4.7"
20
20
  spec.add_development_dependency "fakes3"
21
+ spec.add_development_dependency "aws-s3"
21
22
 
22
23
  spec.add_dependency "activeresource", ">= 3.0"
23
24
  end
@@ -3,7 +3,6 @@ require "active_resource"
3
3
  require "jackie/base"
4
4
  require "jackie/app"
5
5
  require "jackie/version"
6
- require "jackie/aws_uploader"
7
6
 
8
7
  module Jackie
9
8
  def self.api_key=(api_key)
@@ -13,6 +12,7 @@ module Jackie
13
12
  # So, it should be straightforward to add support for ftp or dropbox or whatever.
14
13
  # By creating a uploader (with the public api of AWSUploader) and calling set_uploader with it
15
14
  def self.configure_s3(connection_params, access_params)
15
+ require "jackie/aws_uploader"
16
16
  Jackie::Version.set_uploader(Jackie::AWSUploader.new(connection_params, access_params))
17
17
  end
18
18
  end
@@ -1,7 +1,13 @@
1
+ begin
2
+ require "aws/s3"
3
+ rescue LoadError => e
4
+ $stderr.puts "You don't have aws/s3 installed in your application. Please add it to your Gemfile and run bundle install"
5
+ raise e
6
+ end
7
+
1
8
  module Jackie
2
9
  class AWSUploader
3
10
  def initialize(connection_params, access_params)
4
- load_dependency
5
11
  AWS::S3::Base.establish_connection!(connection_params)
6
12
  @config = access_params
7
13
  end
@@ -10,15 +16,5 @@ module Jackie
10
16
  AWS::S3::S3Object.store(file, open(file), @config[:bucket])
11
17
  AWS::S3::S3Object.url_for(file, @config[:bucket])
12
18
  end
13
-
14
- private
15
- def load_dependency
16
- begin
17
- require "aws/s3"
18
- rescue LoadError => e
19
- $stderr.puts "You don't have aws/s3 installed in your application. Please add it to your Gemfile and run bundle install"
20
- raise e
21
- end
22
- end
23
19
  end
24
- end
20
+ end
@@ -1,7 +1,8 @@
1
1
  module Jackie
2
2
  class Base < ActiveResource::Base
3
- self.site = "https://kickfolio.com/api/"
4
- headers['Accept'] = 'application/vnd.kickfolio.v1'
3
+ self.site = "https://app.io/api/"
4
+ self.format = :json
5
+ headers['Accept'] = 'application/vnd.app.io+json;version=1'
5
6
 
6
7
  class << self
7
8
  def headers
@@ -1,5 +1,5 @@
1
1
  require "test_helper"
2
- class AppTest < Minitest::Test
2
+ class AppTest < MiniTest::Unit::TestCase
3
3
  mock_requests!
4
4
 
5
5
  def setup
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activeresource", "~> 3.0.0"
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activeresource", "~> 3.1.0"
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activeresource", "~> 3.2.0"
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activeresource", :github => "rails/activeresource"
@@ -4,13 +4,13 @@ $LOAD_PATH.unshift testdir unless $LOAD_PATH.include?(testdir)
4
4
  libdir = File.dirname(File.dirname(__FILE__)) + '/lib'
5
5
  $LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)
6
6
 
7
- require "rubygems"
8
7
  require "jackie"
9
8
  require "minitest/autorun"
9
+ require "aws/s3"
10
10
 
11
11
  Jackie.api_key = "MyKickfolioApiKey"
12
12
 
13
- class Minitest::Test
13
+ class MiniTest::Unit::TestCase
14
14
  def with_fake_s3
15
15
  Jackie.configure_s3({
16
16
  :access_key_id => "123",
@@ -53,7 +53,7 @@ class Minitest::Test
53
53
  "updated_at"=>"2013-02-21T20:16:28Z",
54
54
  "comment_ids"=>[]}
55
55
 
56
- @headers = {"Accept"=>"application/vnd.kickfolio.v1", "Authorization"=>"Basic TXlLaWNrZm9saW9BcGlLZXk="}
56
+ @headers = {"Accept"=>"application/vnd.app.io+json;version=1", "Authorization"=>"Basic TXlLaWNrZm9saW9BcGlLZXk="}
57
57
  ActiveResource::HttpMock.respond_to do |mock|
58
58
  mock.get "/api/apps/1.json", @headers, @app
59
59
  mock.get "/api/versions.json?app_id=1", @headers, [@version].to_json
@@ -1,5 +1,5 @@
1
1
  require "test_helper"
2
- class VersionTest < Minitest::Test
2
+ class VersionTest < MiniTest::Unit::TestCase
3
3
  mock_requests!
4
4
 
5
5
  def setup
@@ -15,14 +15,14 @@ class VersionTest < Minitest::Test
15
15
  with_fake_s3 do
16
16
  version = Jackie::Version.new(:app_id => 1, :file => File.basename(__FILE__))
17
17
  version.save
18
- assert_match /http:\/\/localhost:10453\/nuvado-test\/version_test\.rb/, version.bundle_url
18
+ assert_match(/http:\/\/localhost:10453\/nuvado-test\/version_test\.rb/, version.bundle_url)
19
19
  end
20
20
  end
21
21
 
22
22
  def test_create_with_file
23
23
  with_fake_s3 do
24
24
  version = Jackie::Version.create(:app_id => 1, :file => File.basename(__FILE__))
25
- assert_match /http:\/\/localhost:10453\/nuvado-test\/version_test\.rb/, version.bundle_url
25
+ assert_match(/http:\/\/localhost:10453\/nuvado-test\/version_test\.rb/, version.bundle_url)
26
26
  end
27
27
  end
28
28
 
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Lacides Charris
9
9
  - Guillermo Iguaran
10
10
  - Roberto Miranda
11
- - Firebase.co
11
+ - HeapSource
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-05-22 00:00:00.000000000 Z
15
+ date: 2013-06-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
@@ -32,6 +32,22 @@ dependencies:
32
32
  version: '0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: minitest
35
+ requirement: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '4.7'
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '4.7'
49
+ - !ruby/object:Gem::Dependency
50
+ name: fakes3
35
51
  requirement: !ruby/object:Gem::Requirement
36
52
  none: false
37
53
  requirements:
@@ -47,7 +63,7 @@ dependencies:
47
63
  - !ruby/object:Gem::Version
48
64
  version: '0'
49
65
  - !ruby/object:Gem::Dependency
50
- name: fakes3
66
+ name: aws-s3
51
67
  requirement: !ruby/object:Gem::Requirement
52
68
  none: false
53
69
  requirements:
@@ -78,11 +94,11 @@ dependencies:
78
94
  - - ! '>='
79
95
  - !ruby/object:Gem::Version
80
96
  version: '3.0'
81
- description: A Ruby interface to the Kickfolio API.
97
+ description: A Ruby interface to the App.io API.
82
98
  email:
83
- - lacides@firebase.co
84
- - guille@firebase.co
85
- - roberto@firebase.co
99
+ - lacides@heapsource.com
100
+ - guille@heapsource.com
101
+ - roberto@heapsource.com
86
102
  - hello@firebase.co
87
103
  executables: []
88
104
  extensions: []
@@ -102,9 +118,13 @@ files:
102
118
  - lib/jackie/version.rb
103
119
  - test/app_test.rb
104
120
  - test/fixtures/app.json
121
+ - test/gemfiles/Gemfile.ares-3.0.x
122
+ - test/gemfiles/Gemfile.ares-3.1.x
123
+ - test/gemfiles/Gemfile.ares-3.2.x
124
+ - test/gemfiles/Gemfile.ares-4.0.x
105
125
  - test/test_helper.rb
106
126
  - test/version_test.rb
107
- homepage: ''
127
+ homepage: https://github.com/heapsource/jackie
108
128
  licenses:
109
129
  - MIT
110
130
  post_install_message:
@@ -128,9 +148,13 @@ rubyforge_project:
128
148
  rubygems_version: 1.8.25
129
149
  signing_key:
130
150
  specification_version: 3
131
- summary: A Ruby interface to the Kickfolio API
151
+ summary: A Ruby interface to the App.io API
132
152
  test_files:
133
153
  - test/app_test.rb
134
154
  - test/fixtures/app.json
155
+ - test/gemfiles/Gemfile.ares-3.0.x
156
+ - test/gemfiles/Gemfile.ares-3.1.x
157
+ - test/gemfiles/Gemfile.ares-3.2.x
158
+ - test/gemfiles/Gemfile.ares-4.0.x
135
159
  - test/test_helper.rb
136
160
  - test/version_test.rb