publish_my_data 1.3.11 → 1.3.12
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.
- data/README.md +38 -17
- data/app/assets/stylesheets/publish_my_data.scss +1 -1
- data/lib/publish_my_data/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
PublishMyData is a [Rails Engine](http://guides.rubyonrails.org/engines.html) that adds Linked Data functionality to your Rails app including:
|
|
6
6
|
|
|
7
|
-
* URI dereferencing
|
|
7
|
+
* URI dereferencing
|
|
8
8
|
* displaying resources outside your site domain
|
|
9
9
|
* dataset pages to describe graphs of data with additional metadata
|
|
10
10
|
* A SPARQL Endpoint
|
|
@@ -30,7 +30,7 @@ Also: see our [sample app](http://github.com/swirrl/sample_pmd) where we've alre
|
|
|
30
30
|
rails new hello_world -O -T
|
|
31
31
|
|
|
32
32
|
2. Add publish_my_data to your Gemfile. The minimal contents of the gemfile are as follows
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
source 'https://rubygems.org'
|
|
35
35
|
gem 'rails', '3.2.15'
|
|
36
36
|
gem 'publish_my_data'
|
|
@@ -43,7 +43,7 @@ Also: see our [sample app](http://github.com/swirrl/sample_pmd) where we've alre
|
|
|
43
43
|
Fetching gem metadata from https://rubygems.org/..
|
|
44
44
|
Resolving dependencies...
|
|
45
45
|
...
|
|
46
|
-
Installing publish_my_data (1.2.0)
|
|
46
|
+
Installing publish_my_data (1.2.0)
|
|
47
47
|
Your bundle is updated!
|
|
48
48
|
|
|
49
49
|
If you don't see `publish_my_data (1.2.0)` in the output you may need to run `bundle update publish_my_data`
|
|
@@ -63,18 +63,18 @@ If you don't see `publish_my_data (1.2.0)` in the output you may need to run `bu
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
6. Mount it in your `routes.rb`
|
|
66
|
-
|
|
67
|
-
# Note that there is no default home page route for publish_my_data. You need to define your own. e.g.
|
|
68
|
-
|
|
66
|
+
|
|
67
|
+
# Note that there is no default home page route for publish_my_data. You need to define your own. e.g.
|
|
68
|
+
|
|
69
69
|
get '/', to: redirect('/data'), as: :home # use the data catalogue
|
|
70
70
|
|
|
71
71
|
# # or:
|
|
72
72
|
# match '/' => 'home#home', as: 'home'
|
|
73
|
-
|
|
74
73
|
|
|
75
|
-
mount PublishMyData::Engine, at: "/"
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
mount PublishMyData::Engine, at: "/"
|
|
76
|
+
|
|
77
|
+
6. In order for PublishMyData provided-views to be able to use helpers defined by our app, add the following to your `application.rb`:
|
|
78
78
|
|
|
79
79
|
config.to_prepare do
|
|
80
80
|
# include only the ApplicationHelper module in the PMD engine
|
|
@@ -93,7 +93,7 @@ If you don't see `publish_my_data (1.2.0)` in the output you may need to run `bu
|
|
|
93
93
|
%title
|
|
94
94
|
= appname
|
|
95
95
|
= yield :page_title
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
= yield :page_description
|
|
98
98
|
|
|
99
99
|
= javascript_include_tag :modernizr
|
|
@@ -108,7 +108,7 @@ If you don't see `publish_my_data (1.2.0)` in the output you may need to run `bu
|
|
|
108
108
|
9. Add the helpers in your app's `ApplicationController`, and derive from the PublishMyData engines application controller
|
|
109
109
|
|
|
110
110
|
class ApplicationController < PublishMyData::ApplicationController
|
|
111
|
-
protect_from_forgery
|
|
111
|
+
protect_from_forgery
|
|
112
112
|
helper PublishMyData::Engine.helpers
|
|
113
113
|
helper :all
|
|
114
114
|
end
|
|
@@ -127,9 +127,34 @@ If you don't see `publish_my_data (1.2.0)` in the output you may need to run `bu
|
|
|
127
127
|
= render partial:'publish_my_data/shared/subnav_box', locals:{menu:standard_menu_tools}
|
|
128
128
|
= render partial:'publish_my_data/shared/subnav_box', locals:{menu:alternative_menu_docs} # <-- # e.g. this line changed:
|
|
129
129
|
= render partial:'publish_my_data/shared/subnav_box', locals:{menu:standard_menu_pmd}
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
If you define a new helper method to provide the locals (e.g. in our case `alternative_menu_docs`), it can build upon, and adapt the data stucture provided by the existing helpers in `publish_my_data/subnavigation_helper.rb`.
|
|
132
132
|
|
|
133
|
+
## Best practice: Developing with multiple Gemfiles
|
|
134
|
+
|
|
135
|
+
Sometimes when developing an application and the gem concurrently you may prefer to work against a local copy of PublishMyData.
|
|
136
|
+
If you don't want to risk accidentally committing a Gemfile which uses a local gem, there's a useful pattern to follow:
|
|
137
|
+
|
|
138
|
+
1) Make a new file at `local/Gemfile`. (You can put this anywhere, the `local/` part is just our convention).
|
|
139
|
+
|
|
140
|
+
2) Add something like the following to it
|
|
141
|
+
|
|
142
|
+
# LOCAL GEMFILE
|
|
143
|
+
# to use instead of defaul Gemfile:
|
|
144
|
+
#
|
|
145
|
+
# "bundle install --gemfile='local/Gemfile'"
|
|
146
|
+
# "BUNDLE_GEMFILE=local/Gemfile bundle exec rails server"
|
|
147
|
+
|
|
148
|
+
source 'https://rubygems.org'
|
|
149
|
+
|
|
150
|
+
gem 'rails', '3.2.17'
|
|
151
|
+
gem 'publish_my_data', :path => '../../publish_my_data'
|
|
152
|
+
|
|
153
|
+
Optionally, you may wish to gitignore this.
|
|
154
|
+
|
|
155
|
+
3) Do `bundle install --gemfile='local/Gemfile'` to create `local/Gemfile.lock`
|
|
156
|
+
|
|
157
|
+
4) Run your app with eg `BUNDLE_GEMFILE=local/Gemfile bundle exec rails server`
|
|
133
158
|
|
|
134
159
|
##Licence
|
|
135
160
|
|
|
@@ -155,8 +180,4 @@ We roughly try to follow [Github's Ruby Style Guide](https://github.com/stylegui
|
|
|
155
180
|
|
|
156
181
|
#### CSS
|
|
157
182
|
|
|
158
|
-
We
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
183
|
+
We use [Idiomatic CSS](https://github.com/necolas/idiomatic-css).
|
|
@@ -123,9 +123,9 @@ $scope: "";
|
|
|
123
123
|
// ==========================================================================
|
|
124
124
|
|
|
125
125
|
@import "publish_my_data/core/0500-icon-font";
|
|
126
|
+
@import "publish_my_data/core/1000-utilities";
|
|
126
127
|
|
|
127
128
|
#{$scope}{
|
|
128
|
-
@import "publish_my_data/core/1000-utilities";
|
|
129
129
|
@import "publish_my_data/core/1500-icons";
|
|
130
130
|
@import "publish_my_data/core/2000-elements";
|
|
131
131
|
@import "publish_my_data/core/4000-layout";
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: publish_my_data
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.12
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -542,7 +542,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
542
542
|
version: '0'
|
|
543
543
|
segments:
|
|
544
544
|
- 0
|
|
545
|
-
hash:
|
|
545
|
+
hash: 3385214290625724029
|
|
546
546
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
547
547
|
none: false
|
|
548
548
|
requirements:
|