ocean-rails 1.24.0 → 1.24.1

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: 87bd08f85671c4992c934ca277f6722b41469593
4
- data.tar.gz: 7da2a2cb455fca206f1bba21ae1e6de64bf20c49
3
+ metadata.gz: a12616144c2d08098abcda551448945597bbc4dc
4
+ data.tar.gz: 0e805c2dd8ff776d17af51eae166c20a3e7ddd7a
5
5
  SHA512:
6
- metadata.gz: 353eea4d78b9229655cf5188b818fe17ba1bdb3c4848d4f2159bee1453979d6b4e4807d05b150800a8dc79fafc69034216a3ef92f0fdfc6690b2d570e9568aff
7
- data.tar.gz: a55267c566fc79d7331a0ea80051cc4e06b5f5e1de629d56f0c3dfc96bbc5a268de73899be12c01a0ab52e5e20ec8d9ce97411e79fee0a6130ae9d2244f0e1d8
6
+ metadata.gz: 30f51aa0e64e47f1b8ff6157b67f1ecc73052ed08d018606571897d98d243a2477272b68f0acf630ea9bc1b12092f36cf98d1fae376fbe60ef3f248e8c8d3e69
7
+ data.tar.gz: 1d58fe96c820eae7dc1da7f49ed68ab0a8b721f42cce3f839f7e2b12e4661bd2f952ab2456367c5f2f84fc49eadd37d73c2077ad172abb0d10bdc921fa8518ff
@@ -20,6 +20,10 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
20
20
  copy_file "application_controller.rb", "#{Rails.root}/app/controllers/application_controller.rb"
21
21
  end
22
22
 
23
+ def install_application_helper
24
+ copy_file "application_helper.rb", "#{Rails.root}/app/helpers/application_controller.rb"
25
+ end
26
+
23
27
  def install_spec_helper_and_support_files
24
28
  copy_file "spec_helper.rb", "#{Rails.root}/spec/spec_helper.rb"
25
29
  copy_file "hyperlinks.rb", "#{Rails.root}/spec/support/hyperlinks.rb"
@@ -0,0 +1,34 @@
1
+ module ApplicationHelper
2
+
3
+ #
4
+ # Used in Jbuilder templates to build hyperlinks
5
+ #
6
+ def hyperlinks(links={})
7
+ result = {}
8
+ links.each do |qi, val|
9
+ result[qi.to_s] = {
10
+ "href" => val.kind_of?(String) ? val : val[:href],
11
+ "type" => val.kind_of?(String) ? "application/json" : val[:type]
12
+ }
13
+ end
14
+ result
15
+ end
16
+
17
+
18
+ #
19
+ # This is needed everywhere except inside the Auth service to render creator
20
+ # and updater links correctly.
21
+ #
22
+ def api_user_url(x)
23
+ if x.blank?
24
+ "#{OCEAN_API_URL}/#{Api.version_for :api_user}/api_users/0"
25
+ elsif x.is_a?(Integer)
26
+ "#{OCEAN_API_URL}/#{Api.version_for :api_user}/api_users/#{x}"
27
+ elsif x.is_a?(String)
28
+ x
29
+ else
30
+ raise "api_user_url takes an integer, a string, or nil"
31
+ end
32
+ end
33
+
34
+ end
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "1.24.0"
2
+ VERSION = "1.24.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.24.0
4
+ version: 1.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -278,6 +278,7 @@ files:
278
278
  - lib/generators/ocean_scaffold/USAGE
279
279
  - lib/generators/ocean_setup/ocean_setup_generator.rb
280
280
  - lib/generators/ocean_setup/templates/application_controller.rb
281
+ - lib/generators/ocean_setup/templates/application_helper.rb
281
282
  - lib/generators/ocean_setup/templates/config.yml.example
282
283
  - lib/generators/ocean_setup/templates/Gemfile
283
284
  - lib/generators/ocean_setup/templates/gitignore
@@ -322,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
323
  version: '0'
323
324
  requirements: []
324
325
  rubyforge_project:
325
- rubygems_version: 2.1.10
326
+ rubygems_version: 2.0.7
326
327
  signing_key:
327
328
  specification_version: 4
328
329
  summary: This gem implements common Ocean behaviour for Ruby and Ruby on Rails.