gakubuchi 0.2.0 → 0.2.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: 581c86e67d3d350858d9929191d9382656959691
4
- data.tar.gz: 5640d23696f5e820da2b4dcaaccf5ac3e942b062
3
+ metadata.gz: 1edba3f60856d88e7f5529bdbce93eecc0a35313
4
+ data.tar.gz: 32a2cf35012a653ca428642c13b1a0bc3583a7a9
5
5
  SHA512:
6
- metadata.gz: b34bfcb48634bda49914a78e0d4613921294976977bc60b1186ee87b807b88bb1c177b0c08563b9f7470b49e1763b1ef94c535a756536b3bd357e7f9177684d9
7
- data.tar.gz: e592fa46b572100f56648cda5313937010e466e7b2ef0ac876a99b3d2d0338a0b07b5861a5392c8921a76c739cac2468a2999750e5b5294948533eeecd360442
6
+ metadata.gz: b813c7f0e3745f402df939554df6bdd047ded8387ea81fc74dae8d12042f468dd5f1e94dae5519aa894adce4695c5488106bbb71ae8b33f1627f75c227262c8b
7
+ data.tar.gz: 933d064cf2693a53698e4809cc1824e5de2976d05ade332fa31ddc99efb67ebe395b58911034d3535bdcf767b3fcb7480472902362dc084e4543739fee9ed016
data/README.md CHANGED
@@ -5,12 +5,7 @@
5
5
  [![Code Climate](https://codeclimate.com/github/yasaichi/gakubuchi/badges/gpa.svg)](https://codeclimate.com/github/yasaichi/gakubuchi)
6
6
  [![Test Coverage](https://codeclimate.com/github/yasaichi/gakubuchi/badges/coverage.svg)](https://codeclimate.com/github/yasaichi/gakubuchi/coverage)
7
7
 
8
- Gakubuchi is a gem which enables you to manage static pages with Asset Pipeline.
9
-
10
- ## What is Gakubuchi?
11
-
12
- Gakubuchi provides a simple and useful framework to manage static pages (e.g. error pages).
13
- As it uses Asset Pipeline, you can treat them as views of Rails.
8
+ Gakubuchi provides a simple way to manage static pages (e.g. error pages) with Asset Pipeline.
14
9
 
15
10
  ## Quickstart
16
11
  Put this in your Gemfile:
@@ -19,19 +14,27 @@ Put this in your Gemfile:
19
14
  gem 'gakubuchi'
20
15
  ```
21
16
 
22
- In `app/assets/templates/static_page.html.slim`:
17
+ In `app/assets/templates/404.html.slim`:
23
18
 
24
19
  ```slim
25
20
  doctype html
26
21
  html
27
22
  head
28
- title
29
- | Sample Static Page
23
+ title The page you were looking for doesn't exist (404)
24
+ meta name='viewport' content='width=device-width,initial-scale=1'
30
25
  = stylesheet_link_tag 'application', media: 'all'
31
- = javascript_include_tag 'application'
32
26
  body
33
- p
34
- | Hello, Gakubuchi!
27
+ .dialog
28
+ div
29
+ h1 The page you were looking for doesn't exist.
30
+ p You may have mistyped the address or the page may have moved.
31
+ p If you are the application owner check the logs for more information.
32
+ ```
33
+
34
+ Open the following URL in your browser to check the templeate:
35
+
36
+ ```
37
+ http://localhost:3000/assets/404.html
35
38
  ```
36
39
 
37
40
  Compile the templeate with:
@@ -40,20 +43,18 @@ Compile the templeate with:
40
43
  rake assets:precompile
41
44
  ```
42
45
 
43
- Then, you can get `public/static_page.html` as follows.
44
-
45
- ```html
46
- <!DOCTYPE html>
47
- <html>
48
- <head>
49
- <title>Sample Static Page</title><link rel="stylesheet" media="all" href="/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css" /><script src="/assets/application-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js"></script>
50
- </head>
51
- <body>
52
- <p>
53
- Hello, Gakubuchi!
54
- </p>
55
- </body>
56
- </html>
46
+ Then, you can get `public/404.html`.
47
+
48
+ ## Template engines
49
+ Gakubuchi supports some template engines: `ERB`, `Haml` and `Slim`.
50
+ If you want to use `Haml` or `Slim`, you need to put them in your Gemfile:
51
+
52
+ ```ruby
53
+ # Use Haml
54
+ gem 'haml-rails'
55
+
56
+ # Use Slim
57
+ gem 'slim-rails'
57
58
  ```
58
59
 
59
60
  ## Configuration
@@ -72,17 +73,18 @@ remove_precompiled_templates # true by default
72
73
  template_root # 'app/assets/templates' by default
73
74
  ```
74
75
 
75
- ## Supports
76
+ ## Supported versions
76
77
  * Ruby: `2.0.0` or later
77
- * Rails: `4.0.0` or later (supports `3.x` as possible)
78
- * Template engines: `ERB`, `Haml` and `Slim`
78
+ * Rails: `4.0.0` or later
79
79
 
80
80
  ## Contributing
81
81
  You should follow the steps below.
82
82
 
83
- 1. Fork the repository
84
- 2. Create a feature branch
85
- 3. Submit the pull request
83
+ 1. [Fork the repository](https://help.github.com/articles/fork-a-repo/)
84
+ 2. Create a feature branch: `git checkout -b add-new-feature`
85
+ 3. Commit your changes: `git commit -am 'add new feature'`
86
+ 4. Push the branch: `git push origin add-new-feature`
87
+ 4. [Send us a pull request](https://help.github.com/articles/using-pull-requests/)
86
88
 
87
89
  We use [Appraisal](https://github.com/thoughtbot/appraisal) to test with different versions of Rails.
88
90
 
@@ -7,7 +7,7 @@ module Gakubuchi
7
7
 
8
8
  %w(== === eql?).each do |method_name|
9
9
  define_method(method_name) do |other|
10
- other.respond_to?(:pathname) &&
10
+ self.class == other.class &&
11
11
  @pathname.__send__(method_name, other.pathname)
12
12
  end
13
13
  end
@@ -22,7 +22,8 @@ module Gakubuchi
22
22
  end
23
23
 
24
24
  def registered?(extname)
25
- assets.engines[normalize_extension(extname)] == engine
25
+ ext = normalize_extension(extname)
26
+ assets.engines.has_key?(ext) && assets.engines[ext] == engine
26
27
  end
27
28
  end
28
29
  end
@@ -1,3 +1,3 @@
1
1
  module Gakubuchi
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gakubuchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yasaichi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-02 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description: Gakubuchi enables you to manage static pages with Asset Pipeline
125
+ description: Gakubuchi provides a simple way to manage static pages with Asset Pipeline.
126
126
  email:
127
127
  - yasaichi@users.noreply.github.com
128
128
  executables: []