moj_template 0.5.1 → 0.5.2

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: 47b05a206676891278338458e932b35ce1da2ca4
4
- data.tar.gz: ac3e9446fbe5ac85759b43324a0c4d0d34d5a77a
3
+ metadata.gz: e798207d94a88fc8993897fbe6a0222a9c64a340
4
+ data.tar.gz: 64848fd216114cf62a7e9887aa9e3437c5f9111d
5
5
  SHA512:
6
- metadata.gz: 617d074049a1153464a0748b4b4faa3cd40ada17e899f9fac7d7688b8912b1cd88da2c32fcaeaafc74bcb61af7a36b25a0237e081f7822d97bfe31503daea55a
7
- data.tar.gz: 39afa24212b6f6837fa9d1f7ded5a89843c538b921e92b8bfdf54edc22c01cfe27a78c0c66afa03613a11eb52010e3fa7c6c52ac5442f40677142f6014c5af4f
6
+ metadata.gz: 7d258eca9a727d5de32aa3694781ab8d638cdfd160af7d18f014902605d5108b36bd140133b2cfe3a31fc55861e3f71fefb83772bdb7f2ae73cee9ee428f8f54
7
+ data.tar.gz: 692216f2b2ee4ffe6f2e683f23b3463b4392ebf40e43f57c586cf2e038acdb052c98a9246ff3a359facaae9256d6aa0265f413e226626c918dba6f8ee4901d38
data/README.md CHANGED
@@ -25,11 +25,11 @@ At present this generates 5 output formats:
25
25
 
26
26
  To use it, add this line to your application's Gemfile (change the tag to the version you would like to use):
27
27
 
28
- gem 'moj_template', git: 'https://github.com/ministryofjustice/moj_template.git', tag: 'v0.1.0'
28
+ gem 'moj_template', '~> 0.1.0'
29
29
 
30
30
  And then execute:
31
31
 
32
- $ bundle
32
+ bundle
33
33
 
34
34
  You can then use the `moj_template` layout in your app. If you need to extend the layout you can use [nested layouts](http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts).
35
35
 
@@ -56,21 +56,31 @@ In order for these files to work, you will need to set a number of variables in
56
56
 
57
57
  ### Django version
58
58
 
59
- To use the django package, add it to your app using:
59
+ To use the django package, add the following package to `requirements.txt`:
60
60
 
61
- pip install moj_template
61
+ django-moj-template==0.1.0
62
62
 
63
- Then extend your base template from the moj_template using:
63
+ Then run:
64
+
65
+ pip install -r requirements.txt
66
+
67
+ Add `moj_template` to your `INSTALLED_APPS` in your `settings.py` file. Eg:
68
+
69
+ INSTALLED_APPS = (
70
+ ...
71
+ 'moj_template',
72
+ ...
73
+ )
74
+
75
+ Then to use the template in your application extend your base template from the `moj_template` using:
64
76
 
65
77
  {% extends 'moj_template/base.html' %}
66
78
 
67
79
  #### Django Config
68
80
 
69
- You will be required to set up some additional config to use the package. Add the following to your `TEMPLATE_CONTEXT_PROCESSORS`:
70
-
71
- "{app_path}.apps.core.context_processors.globals"
81
+ You will be required to set up some additional config to use the package.
72
82
 
73
- Then include the following in a new file called `apps/core/context_processors.py`:
83
+ Create a new file called `{app_path}/context_processors.py` with the following contents:
74
84
 
75
85
  def globals(request):
76
86
  return {
@@ -82,6 +92,10 @@ Then include the following in a new file called `apps/core/context_processors.py
82
92
  'ga_id': '' # Google Analytics ID (Tracking ID for the service)
83
93
  }
84
94
 
95
+ Then add the following to your `TEMPLATE_CONTEXT_PROCESSORS` in `settings.py`:
96
+
97
+ "{app_path}.context_processors.globals"
98
+
85
99
  ### Play version
86
100
 
87
101
  To generate the tarball of Play Framework templates run `bundle exec rake build:play`. This will produce a tarball in the `pkg` directory.
@@ -104,6 +118,17 @@ To generate the folder of Liquid templates run `bundle exec rake build:liquid`.
104
118
 
105
119
  To generate the tarball, run the `bundle exec rake build:tar` rake task. This will produce a tarball in the `pkg` directory.
106
120
 
121
+ ## Publishing
122
+
123
+ After an accepted contribution (pull request merged into master) you must checkout master and run the following command to publish the current versions:
124
+
125
+ bundle exec rake publish
126
+
127
+ This will trigger a build and on success publish the following packages:
128
+
129
+ * [A gem on RubyGems.org](https://rubygems.org/gems/moj_template)
130
+ * [A Django python package](https://pypi.python.org/pypi/django-moj-template)
131
+
107
132
  ## Development
108
133
 
109
134
  The source files are in the `/source` directory. The `compile` rake task builds the `/app` contents from these sources. This process involves the following:
@@ -1,3 +1,3 @@
1
1
  module MojTemplate
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moj_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dom Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2014-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails