stagebloc 1.0.1 → 1.0.2

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: ac0586450b662377593100c192cd9911488b4480
4
- data.tar.gz: f57dc051c46f1c9bb05abbd7c059055fb28a00a4
3
+ metadata.gz: 8f7c679cdab75d6c215f4a1aa4ded070f1c052ff
4
+ data.tar.gz: efcd7d5af743ffc763a85bc0ee0a903234858977
5
5
  SHA512:
6
- metadata.gz: 7c73c3f53f62b82243829940016f88b76a690943fcb576ce9fbccbcf60d4c9b0efcb98d6d3a2e99207a883171b9c47f3a4974fa3a72651fa10a6cbec3a81bac3
7
- data.tar.gz: 19198f946542f27dc8e81bee5f8006321054c62d715ce64fc23bf3bd04f963682195f4999769a92a90809c5182e311db03fdb504ae9e3546671d39e2f8442097
6
+ metadata.gz: 086b68f2a6008daa79e42d2e79486ca6ded3cb75a7dc81b5cf96c35933fbce20d1805988b26886c924fd31b316446c940e3164825a35a270cf7d401d84d12550
7
+ data.tar.gz: ed57ad8e5af9fc75680e19a5db05c849e530b476c63108f0ebbb1f6859842cafa56b5b5a4ddb58c351cadf64de22caf2e0a539857f8fcb622c9b7f26be839e55
@@ -1,6 +1,16 @@
1
- = stagebloc
1
+ = StageBloc Gem 'stagebloc'
2
2
 
3
- Description goes here.
3
+ This gem contains an interface to the StageBloc API methods using HTTParty.
4
+
5
+ == StageBloc API calls included [current]
6
+
7
+ * /account/:id
8
+ * /account/:id/children
9
+ * /account/:id/audio/:id
10
+
11
+ == Dev Todo
12
+
13
+ * Implement a better HTTP solution like Faraday
4
14
 
5
15
  == Contributing to stagebloc
6
16
 
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Jeweler::Tasks.new do |gem|
20
20
  gem.description = %Q{This gem provides an interface for all the basic API methods on the StageBloc API. We are adding more as we find them!}
21
21
  gem.email = "miller.dain@gmail.com"
22
22
  gem.authors = ["Dain Miller"]
23
- gem.version = "1.0.1"
23
+ gem.version = "1.0.2"
24
24
  # dependencies defined in Gemfile
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
@@ -0,0 +1,29 @@
1
+ class Stagebloc
2
+
3
+ BASE_URL = "https://api.stagebloc.com/v1"
4
+
5
+ def initialize client_id
6
+ @client ||= "client_id=#{client_id}"
7
+ end
8
+
9
+ def account account_id
10
+ get "#{BASE_URL}/account/#{account_id}?#{@client}"
11
+ end
12
+
13
+ def children_for_account account_id
14
+ get("#{BASE_URL}/account/#{account_id}/children?#{@client}")['child_accounts']
15
+ end
16
+
17
+ def get_audio account_id, audio_id
18
+ get "#{BASE_URL}/account/#{account_id}/audio/#{audio_id}?#{@client}"
19
+ end
20
+
21
+ private
22
+ def get url
23
+ parse_response(HTTParty.get(url).body)['data']
24
+ end
25
+
26
+ def parse_response resp
27
+ JSON.parse(resp)
28
+ end
29
+ end
Binary file
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: stagebloc 1.0.1 ruby lib
5
+ # stub: stagebloc 1.0.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "stagebloc"
9
- s.version = "1.0.1"
9
+ s.version = "1.0.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Dain Miller"]
14
- s.date = "2015-05-12"
14
+ s.date = "2015-05-13"
15
15
  s.description = "This gem provides an interface for all the basic API methods on the StageBloc API. We are adding more as we find them!"
16
16
  s.email = "miller.dain@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "README.rdoc",
27
27
  "Rakefile",
28
28
  "lib/stagebloc.rb",
29
+ "stagebloc-1.0.1.gem",
29
30
  "stagebloc.gemspec",
30
31
  "test/helper.rb",
31
32
  "test/test_stagebloc.rb"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stagebloc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dain Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda
@@ -96,6 +96,7 @@ files:
96
96
  - README.rdoc
97
97
  - Rakefile
98
98
  - lib/stagebloc.rb
99
+ - stagebloc-1.0.1.gem
99
100
  - stagebloc.gemspec
100
101
  - test/helper.rb
101
102
  - test/test_stagebloc.rb