hullio 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzVkZjA3YzQ3OTA5MTA3NGJiZWFhOTA3NmZjMWE0ZDc4YmNjMTI3NA==
4
+ YzcyNmUxYjgyZjVhNzE5N2RjOTE2YmRhZjE5MDQyMWVmMmVkMDA1Mg==
5
5
  data.tar.gz: !binary |-
6
- NTk3ZDA3NzVhZDg4ODk1Yzk0NzU3ZWJkNTA2OWI1NmU0MDE5ZmRjMg==
6
+ NmIyZmY1OTkzYTkxMjkxZjhiM2VjZTYyYzAzM2Q1NTIxNzc3N2Q5NQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTRmM2YzNDY5YTk0YjlhYmZjYzdjN2VhZmI2ZTMxMjNjYjVmYjZhMzFhZDFj
10
- ZThhZmE1MWIyZGMxM2NkYmViMmJhNjhkMzQzZTZkMzAwNTc3MDdkZjVmNThh
11
- ZmQ0NmIyOTkzZGE2OWExNzUyNjNmMjRiZTliZDdhNGFmYzVhNzc=
9
+ YTAzM2IxZmFiNmJhNmJiZjUxZTY5NzBjMjA2NDczNjM0YjFmMTk5ZTY5NzVi
10
+ ZjUwYmM1YTZkZWNhN2VkNzI1ZWVkYTM0MTIzMTIyNGQ0ZjUzZjdmMDAwYjMw
11
+ NTI0YWUxNzUwMDYzMmU5YWYwYmNhZjI3ZTU5ZjA4NjU3ODU4MDg=
12
12
  data.tar.gz: !binary |-
13
- ZDI0NjA5OTgyMjM4MTNlNTA4YmM0MWViOWJhMDcxY2ZiYzAzYTdmOWE5NTc1
14
- NjhhNzA2NzA2MGNiZDI5NTY3MGVjZTkzMDQwZWYzNjQ2YzNkMjBkY2JjOWE2
15
- MjljYjgyZWI1NDVhOGQ2ZTdkZTc3Y2U3MTdiZjg3YWZjOGU2OGM=
13
+ OTkwYjlhZDA0NDE5YmUwNGZhMGI0YTJjODFjN2U1MzU3ODE3MjE2YWJkMGVi
14
+ NzdiYjRkZDlhNjQ2ZDQwZjM4MTJjZTc0OWIxZjk3NzgwM2NkZDQyNTkyNTU5
15
+ YzQ0YzIxYzgyNzc2MDVhNzQ4ODM5MDNlZTc3MzhiMjg0ZTA5NjM=
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # Hull Ruby client
2
2
 
3
- TODO: Write a gem description
4
-
5
3
  ## Installation
6
4
 
7
5
  Add this line to your application's Gemfile:
@@ -23,7 +21,7 @@ Or install it yourself as:
23
21
  Hull.configure do |c|
24
22
  c.app_id = "your-app-id"
25
23
  c.app_secret = "your-app-secret"
26
- c.endpoint = "http://ORG-NAMESPACE.hullapp.io"
24
+ c.org_url = "http://ORG-NAMESPACE.hullapp.io"
27
25
  end
28
26
 
29
27
  ### Making API Calls
@@ -48,6 +46,32 @@ with Hull entities :
48
46
  Hull.delete('entity', { uid: 'http://example.com' })
49
47
 
50
48
 
49
+ ### Compiling widgets and tempaltes with Rails' Assets Pipeline
50
+
51
+ Load `handlebars_assets` in your Gemfile as part of the assets group
52
+
53
+ group :assets do
54
+ gem 'handlebars_assets'
55
+ end
56
+
57
+
58
+ Place your widgets inside the `app/assets/javascripts` dir.
59
+
60
+ app
61
+ ├── assets
62
+ │   ├── javascripts
63
+ │   │   ├── application.js
64
+ │   │   └── hello
65
+ │   │   ├── hello.hbs
66
+ │   │   └── main.js
67
+
68
+ And require the in your `application.js` file :
69
+
70
+
71
+ //= require handlebars
72
+ //= require_tree .
73
+
74
+
51
75
  ### Bring your own users
52
76
 
53
77
  In addition to providing multiple social login options, Hull allows you to create and authenticate users that are registered within your own app.
@@ -59,12 +83,13 @@ In you view :
59
83
  <script>
60
84
  Hull.init({
61
85
  appId: "<%= Hull.app_id %>",
62
- orgUrl: "<%= Hull.endpoint %>",
86
+ orgUrl: "<%= Hull.org_url %>",
63
87
  userHash: "<%= Hull.user_hash({ id: "123", email: "bill@hullapp.io", name: "Bill Evans" }) %>"
64
88
  });
65
89
  </script>
66
90
 
67
91
 
92
+
68
93
  ## Contributing
69
94
 
70
95
  1. Fork it
@@ -16,8 +16,8 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Hull::VERSION
17
17
 
18
18
  # Dependencies
19
- gem.add_dependency 'faraday', '~> 0.8'
20
- gem.add_dependency 'faraday_middleware', '~> 0.9'
19
+ gem.add_dependency 'faraday'
20
+ gem.add_dependency 'faraday_middleware'
21
21
  gem.add_dependency 'multi_json'
22
22
  gem.add_dependency 'mime-types'
23
23
 
@@ -16,9 +16,10 @@ module Hull
16
16
  DEFAULT_APP_ID = ENV['HULL_APP_ID']
17
17
 
18
18
 
19
- # The endpoint that will be used to connect if none is set
19
+ # The ORG_URL that will be used to connect if none is set
20
20
  #
21
- DEFAULT_ENDPOINT = ENV['HULL_ORG_URL']
21
+ DEFAULT_ORG_URL = ENV['HULL_ORG_URL']
22
+ DEFAULT_JS_URL = ENV['HULL_JS_URL']
22
23
 
23
24
  DEFAULT_CACHE_STORE = nil
24
25
 
@@ -29,6 +30,8 @@ module Hull
29
30
 
30
31
  DEFAULT_LOGGER = nil
31
32
 
33
+ DEFAULT_CURRENT_USER = Proc.new { self.respond_to?(:current_user) ? current_user : @user }
34
+
32
35
  # An array of valid keys in the options hash when configuring a {Hull::Client}
33
36
  VALID_OPTIONS_KEYS = [
34
37
  :proxy,
@@ -36,16 +39,19 @@ module Hull
36
39
  :connection_options,
37
40
  :app_id,
38
41
  :app_secret,
39
- :endpoint,
42
+ :org_url,
40
43
  :user_agent,
41
44
  :cache_store,
42
- :logger
45
+ :logger,
46
+ :current_user,
47
+ :user_attributes,
48
+ :js_url
43
49
  ]
44
50
 
45
51
  attr_accessor *VALID_OPTIONS_KEYS
46
52
 
47
53
  def domain
48
- @domain ||= URI.parse(endpoint).host unless endpoint.nil?
54
+ @domain ||= URI.parse(org_url).host unless org_url.nil?
49
55
  end
50
56
 
51
57
  # When this module is extended, set all configuration options to their default values
@@ -75,9 +81,11 @@ module Hull
75
81
  self.connection_options = DEFAULT_CONNECTION_OPTIONS
76
82
  self.app_id = DEFAULT_APP_ID
77
83
  self.app_secret = DEFAULT_APP_SECRET
78
- self.endpoint = DEFAULT_ENDPOINT
84
+ self.org_url = DEFAULT_ORG_URL
85
+ self.js_url = DEFAULT_JS_URL
79
86
  self.user_agent = DEFAULT_USER_AGENT
80
87
  self.cache_store = DEFAULT_CACHE_STORE
88
+ self.current_user = DEFAULT_CURRENT_USER
81
89
  self
82
90
  end
83
91
 
@@ -18,7 +18,7 @@ module Hull
18
18
  :user_agent => user_agent,
19
19
  },
20
20
  :ssl => {:verify => false},
21
- :url => options.fetch(:endpoint, endpoint),
21
+ :url => options.fetch(:org_url, org_url),
22
22
  :timeout => 10,
23
23
  :proxy => options.fetch(:proxy, proxy),
24
24
  :open_timeout => 10
@@ -74,7 +74,7 @@ module Hull
74
74
  Hull.configure do |config|
75
75
  config.app_id = @options[:app_id] || ENV['HULL_APP_ID']
76
76
  config.app_secret = @options[:app_secret] || ENV['HULL_APP_SECRET']
77
- config.endpoint = @options[:endpoint] || ENV['HULL_ORG_URL']
77
+ config.org_url = @options[:org_url] || ENV['HULL_ORG_URL']
78
78
  end
79
79
  @paths = @options[:paths].map { |k,v| [Regexp.new(k), v] }
80
80
  end
@@ -1,3 +1,3 @@
1
1
  module Hull
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hullio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephane Bellity
@@ -9,36 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-22 00:00:00.000000000 Z
12
+ date: 2013-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
- version: '0.8'
20
+ version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - ! '>='
26
26
  - !ruby/object:Gem::Version
27
- version: '0.8'
27
+ version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: faraday_middleware
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
- version: '0.9'
34
+ version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - ! '>='
40
40
  - !ruby/object:Gem::Version
41
- version: '0.9'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: multi_json
44
44
  requirement: !ruby/object:Gem::Requirement