ocean-rails 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a12616144c2d08098abcda551448945597bbc4dc
|
4
|
+
data.tar.gz: 0e805c2dd8ff776d17af51eae166c20a3e7ddd7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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.
|
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-
|
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.
|
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.
|