boned 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,11 @@
1
1
  BONED, CHANGES
2
2
 
3
+ #### 0.3.2 (2010-12-20) ###############################
4
+
5
+ * FIXED: Boned.allow_register
6
+ * CHANGE: check_signature adds http/https to host uri
7
+
8
+
3
9
  #### 0.3.1 (2010-12-17) ###############################
4
10
 
5
11
  * FIXED: Boned::VERSION
data/README.md CHANGED
@@ -6,10 +6,20 @@
6
6
 
7
7
  ## Running
8
8
 
9
- $ redis-server config/redis-server.conf
10
- $ export BONED_SOURCE=redis://localhost:8045/
11
- $ boned start
9
+ $ redis-server path/2/redis-server.conf
12
10
 
11
+ $ BONED_SOURCE=redis://localhost:6379/ boned -e prod start
12
+
13
+ ## Running as a daemon ##
14
+
15
+ $ BONED_SOURCE=redis://localhost:6379/ boned -e prod -d start
16
+ $ boned -e prod -d stop
17
+
18
+ ## Updating bone configuration ##
19
+
20
+ You need to tell bone to use the HTTP API. In your .bashrc or equivalent, add:
21
+
22
+ export BONE_SOURCE=http://127.0.0.1:3073/
13
23
 
14
24
  ## Installation
15
25
 
data/Rakefile CHANGED
@@ -25,8 +25,8 @@ begin
25
25
  gem.email = "delano@solutious.com"
26
26
  gem.homepage = "https://github.com/solutious/boned"
27
27
  gem.authors = ["Delano Mandelbaum"]
28
- gem.add_dependency("bone", ">= 0.3.1")
29
- gem.add_dependency("sinatra", ">= 1.0.0")
28
+ gem.add_dependency("bone", ">= 0.3.2")
29
+ gem.add_dependency("sinatra", ">= 1.1.0")
30
30
  gem.add_dependency("thin")
31
31
  end
32
32
  Jeweler::GemcutterTasks.new
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :MAJOR: 0
3
3
  :MINOR: 3
4
- :PATCH: 1
4
+ :PATCH: 2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{boned}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Delano Mandelbaum"]
12
- s.date = %q{2010-12-17}
12
+ s.date = %q{2010-12-20}
13
13
  s.default_executable = %q{boned}
14
14
  s.description = %q{HTTP server companion for Bone (remote environment variables)}
15
15
  s.email = %q{delano@solutious.com}
@@ -53,17 +53,17 @@ Gem::Specification.new do |s|
53
53
  s.specification_version = 3
54
54
 
55
55
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
56
- s.add_runtime_dependency(%q<bone>, [">= 0.3.1"])
57
- s.add_runtime_dependency(%q<sinatra>, [">= 1.0.0"])
56
+ s.add_runtime_dependency(%q<bone>, [">= 0.3.2"])
57
+ s.add_runtime_dependency(%q<sinatra>, [">= 1.1.0"])
58
58
  s.add_runtime_dependency(%q<thin>, [">= 0"])
59
59
  else
60
- s.add_dependency(%q<bone>, [">= 0.3.1"])
61
- s.add_dependency(%q<sinatra>, [">= 1.0.0"])
60
+ s.add_dependency(%q<bone>, [">= 0.3.2"])
61
+ s.add_dependency(%q<sinatra>, [">= 1.1.0"])
62
62
  s.add_dependency(%q<thin>, [">= 0"])
63
63
  end
64
64
  else
65
- s.add_dependency(%q<bone>, [">= 0.3.1"])
66
- s.add_dependency(%q<sinatra>, [">= 1.0.0"])
65
+ s.add_dependency(%q<bone>, [">= 0.3.2"])
66
+ s.add_dependency(%q<sinatra>, [">= 1.1.0"])
67
67
  s.add_dependency(%q<thin>, [">= 0"])
68
68
  end
69
69
  end
@@ -37,7 +37,8 @@ module Boned
37
37
  # The value is automatically frozen so it will only
38
38
  # work once per instance of Ruby.
39
39
  def allow_register= v
40
- @allow_register = v.freeze unless @allow_register.frozen?
40
+ @allow_register = v
41
+ @allow_register.freeze unless @allow_register.frozen?
41
42
  end
42
43
  end
43
44
  end
@@ -7,7 +7,9 @@ class Boned::APIBase < Sinatra::Base
7
7
  set :static => true
8
8
 
9
9
  configure :dev do
10
+ Boned.allow_register = true
10
11
  Bone.info "Environment: #{ENV['RACK_ENV']}"
12
+ Bone.info "Register enabled: #{Boned.allow_register}"
11
13
  register Sinatra::Reloader
12
14
  dont_reload "lib/**/*.rb"
13
15
  also_reload "lib/boned.rb"
@@ -15,7 +17,6 @@ class Boned::APIBase < Sinatra::Base
15
17
  #Bone.debug = true
16
18
  Bone.info $/, $/, "--> #{request_method} #{current_uri_path}"
17
19
  content_type 'text/plain'
18
- Boned.allow_register = true
19
20
  end
20
21
  end
21
22
 
@@ -117,8 +118,9 @@ class Boned::APIBase < Sinatra::Base
117
118
  generic_error "[sig-expired] #{stamp}" if (now - stamp) > 30.seconds
118
119
  tobj = Bone::API::Redis::Token.new request_token
119
120
  secret = tobj.secret.value
121
+ host = '%s://%s' % [secure? ? 'https' : 'http', current_host]
120
122
  path = current_uri_path.split('?').first
121
- sig = Bone::API::HTTP.generate_signature secret, current_host, request_method, path, qs, body_content
123
+ sig = Bone::API::HTTP.generate_signature secret, host, request_method, path, qs, body_content
122
124
  generic_error "[sig-mismatch] #{sig}" if sig != request_signature
123
125
  Bone.new request_token
124
126
  end
@@ -1,5 +1,8 @@
1
1
  # try try/10_basics_try.rb
2
2
 
3
+ # An instance of boned must be running:
4
+ # ruby -rubygems bin/boned -e dev -d start
5
+
3
6
  require 'boned'
4
7
  #Bone.debug = true
5
8
  Bone.source = "http://localhost:3073"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boned
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Delano Mandelbaum
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-17 00:00:00 -05:00
18
+ date: 2010-12-20 00:00:00 -05:00
19
19
  default_executable: boned
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 17
29
+ hash: 23
30
30
  segments:
31
31
  - 0
32
32
  - 3
33
- - 1
34
- version: 0.3.1
33
+ - 2
34
+ version: 0.3.2
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 23
45
+ hash: 19
46
46
  segments:
47
47
  - 1
48
+ - 1
48
49
  - 0
49
- - 0
50
- version: 1.0.0
50
+ version: 1.1.0
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency