assistly 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,7 +65,7 @@ module Assistly
65
65
  # @see http://en.blog.wordpress.com/2009/12/12/twitter-api/
66
66
  # @see http://staff.tumblr.com/post/287703110/api
67
67
  # @see http://developer.typepad.com/typepad-twitter-api/twitter-api.html
68
- DEFAULT_ENDPOINT = "https://#{DEFAULT_SUBDOMAIN}.assistly.com/api/#{DEFAULT_VERSION}/".freeze
68
+ # DEFAULT_ENDPOINT = "https://#{self.subdomain}.assistly.com/api/#{Assistly.version}/"
69
69
 
70
70
  # @private
71
71
  attr_accessor *VALID_OPTIONS_KEYS
@@ -90,7 +90,7 @@ module Assistly
90
90
  self.adapter = DEFAULT_ADAPTER
91
91
  self.consumer_key = DEFAULT_CONSUMER_KEY
92
92
  self.consumer_secret = DEFAULT_CONSUMER_SECRET
93
- self.endpoint = DEFAULT_ENDPOINT
93
+ self.endpoint = "https://#{Assistly.subdomain}.assistly.com/api/#{Assistly.version}/"
94
94
  self.format = DEFAULT_FORMAT
95
95
  self.oauth_token = DEFAULT_OAUTH_TOKEN
96
96
  self.oauth_token_secret = DEFAULT_OAUTH_TOKEN_SECRET
@@ -1,4 +1,4 @@
1
1
  module Assistly
2
2
  # The version of the gem
3
- VERSION = '0.1.1'.freeze unless defined?(::Assistly::VERSION)
3
+ VERSION = '0.1.2'.freeze unless defined?(::Assistly::VERSION)
4
4
  end
@@ -45,11 +45,11 @@ describe Assistly do
45
45
  end
46
46
  end
47
47
 
48
- describe ".endpoint" do
49
- it "should return the default endpoint" do
50
- Assistly.endpoint.should == Assistly::Configuration::DEFAULT_ENDPOINT
51
- end
52
- end
48
+ # describe ".endpoint" do
49
+ # it "should return the default endpoint" do
50
+ # Assistly.endpoint.should == Assistly::Configuration::DEFAULT_ENDPOINT
51
+ # end
52
+ # end
53
53
 
54
54
  describe ".endpoint=" do
55
55
  it "should set the endpoint" do
@@ -57,6 +57,34 @@ describe Assistly do
57
57
  Assistly.endpoint.should == 'http://tumblr.com/'
58
58
  end
59
59
  end
60
+
61
+ describe ".subdomain=" do
62
+ before do
63
+ Assistly.subdomain = "zencoder"
64
+ end
65
+
66
+ it "should set the subdomain" do
67
+ Assistly.subdomain.should == "zencoder"
68
+ end
69
+
70
+ it "should change the endpoint" do
71
+ Assistly.endpoint.should == "https://zencoder.assistly.com/api/#{Assistly::Configuration::DEFAULT_VERSION}/"
72
+ end
73
+ end
74
+
75
+ describe ".version=" do
76
+ before do
77
+ Assistly.version = "v4"
78
+ end
79
+
80
+ it "should set the subdomain" do
81
+ Assistly.version.should == "v4"
82
+ end
83
+
84
+ it "should change the endpoint" do
85
+ Assistly.endpoint.should == "https://#{Assistly::Configuration::DEFAULT_SUBDOMAIN}.assistly.com/api/v4/"
86
+ end
87
+ end
60
88
 
61
89
  describe ".format" do
62
90
  it "should return the default format" do
@@ -20,7 +20,7 @@ describe Faraday::Response do
20
20
 
21
21
  before do
22
22
  stub_get('users/1.json').
23
- with(:headers => {'Accept'=>'application/json', 'User-Agent'=>'Assistly Ruby Gem 0.1'}).
23
+ with(:headers => {'Accept'=>'application/json', 'User-Agent'=>Assistly::Configuration::DEFAULT_USER_AGENT}).
24
24
  to_return(:status => status)
25
25
  end
26
26
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assistly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Warren