mite-rb 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## mite-rb Changelog
2
2
 
3
+ ### 0.4.3 / 2012-03-29
4
+
5
+ * The mite.api can only be accessed over HTTPS from now on
6
+
3
7
  ### 0.4.2 / 2012-02-22
4
8
 
5
9
  * Fixed require issue with Mite::VERSION
data/lib/mite/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mite
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
data/lib/mite-rb.rb CHANGED
@@ -8,13 +8,13 @@ require 'mite/version.rb'
8
8
  module Mite
9
9
 
10
10
  class << self
11
- attr_accessor :email, :password, :host_format, :domain_format, :protocol, :port, :user_agent
12
- attr_reader :account, :key
11
+ attr_accessor :email, :password, :host_format, :domain_format, :port, :user_agent
12
+ attr_reader :account, :key, :protocol
13
13
 
14
14
  # Sets the account name, and updates all resources with the new domain.
15
15
  def account=(name)
16
16
  resources.each do |klass|
17
- klass.site = klass.site_format % (host_format % [protocol, domain_format % name, ":#{port}"])
17
+ klass.site = klass.site_format % (host_format % ['https', domain_format % name, ":#{port}"])
18
18
  end
19
19
  @account = name
20
20
  end
@@ -45,6 +45,10 @@ module Mite
45
45
  end
46
46
  @user_agent = user_agent
47
47
  end
48
+
49
+ def protocol=(protocol)
50
+ $stderr.puts "WARNING: mite.api can only be accessed over HTTPS." unless protocol == 'https'
51
+ end
48
52
 
49
53
  def resources
50
54
  @resources ||= []
@@ -69,7 +73,6 @@ module Mite
69
73
 
70
74
  self.host_format = '%s://%s%s'
71
75
  self.domain_format = '%s.mite.yo.lk'
72
- self.protocol = 'https'
73
76
  self.port = ''
74
77
  self.user_agent = "mite-rb/#{Mite::VERSION}"
75
78
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mite-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-21 00:00:00.000000000 Z
12
+ date: 2012-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activeresource
16
- requirement: &2155987560 !ruby/object:Gem::Requirement
16
+ requirement: &2159838040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.3.14
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2155987560
24
+ version_requirements: *2159838040
25
25
  description: The official ruby library for interacting with the RESTful mite.api.
26
26
  email:
27
27
  - sebastian@yo.lk