repres-hyper_text 1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 75e2354a6c4525b5cd5360138efea6eb10dd421d
4
+ data.tar.gz: a83f7c40dd84ce4917abc2c92177e02b78ac50d3
5
+ SHA512:
6
+ metadata.gz: c33638dfc872a4e0bd4ef10cea5aa8e85804a5ed017a64ce4ef711a3ebec4446b050da0e24409027c44bb548d5ea9de1fe28635ab72ca0fa8fbe947065e8fa02
7
+ data.tar.gz: 912c8a35db44dab738db868392a4e962ebf7693ef7ce8fee540daeee92e360d1f0f7b6c20f1c7acfde4139c85d3a1691ef0fabd5342ffc15b3b749bd0d6eb17d
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Topbit Du
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # Repres HyperText 超文本资源表现引擎
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
4
+ [![Gem Version](https://badge.fury.io/rb/repres-hyper_text.svg)](https://badge.fury.io/rb/repres-hyper_text)
5
+
6
+ Repres (REsource PRESentation) is a series of resource presentation engines. The Hyper Text resource presentation engine includes HyperText-based resource presentation templates & snippets.
7
+ Repres (资源表现)是一系列的资源表现引擎。超文本资源表现引擎包括基于超文本的资源表现模版和片段。
8
+
9
+
10
+
11
+ ## Recent Update
12
+ Check out the [Road Map](ROADMAP.md) to find out what's the next.
13
+ Check out the [Change Log](CHANGELOG.md) to find out what's new.
14
+
15
+
16
+
17
+ ## Usage in Gemfile
18
+ ```ruby
19
+ gem 'repres-hyper_text'
20
+ ```
21
+
22
+
23
+
24
+ ## Include the Helper in your Application Controller before Render the Style or Script
25
+ ```ruby
26
+ helper Repres::HyperText::ApplicationHelper
27
+ ```
28
+
29
+
30
+
31
+ ## Render the Pre-defined Partials
32
+ ```erb
33
+ <html>
34
+
35
+ <head>
36
+ <%= render partial: 'repres/hyper_text/meta' %>
37
+ <%= render partial: 'repres/hyper_text/icon' %>
38
+ <%= render partial: 'repres/hyper_text/style', locals: { options: { 'font-awesome' => true } } %>
39
+ </head>
40
+
41
+ <body>
42
+ <div id='main'></div>
43
+ <div id='alpha-dialog'></div>
44
+ <div id='beta-dialog'></div>
45
+ <div id='gammar-dialog'></div>
46
+ <%= render partial: 'repres/hyper_text/script', locals: { options: { jquery: true } } %>
47
+ </body>
48
+
49
+ </html>
50
+ ```
51
+
52
+
53
+
54
+ ### Render the Meta
55
+ The Meta partial includes the HTML meta tags for HTML 5.
56
+ ```erb
57
+ <%= render partial: 'repres/hyper_text/meta' %>
58
+ ```
59
+
60
+ The source codes of the Meta partial:
61
+ ```html
62
+ <meta charset="UTF-8" />
63
+ <meta name="format-detection" content="telephone=no" />
64
+ <meta name="msapplication-tap-highlight" content="no" />
65
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
66
+ <meta name="renderer" content="webkit" />
67
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
68
+ ```
69
+
70
+
71
+
72
+ ### Render the Favorite Icon
73
+ The Icon partial includes the HTML link tags for Favorite Icons.
74
+ ```erb
75
+ <%= render partial: 'repres/hyper_text/icon',
76
+ locals: {
77
+ options: {
78
+ safari_mask_icon_color: '#5bbad5',
79
+ microsoft_application_title_color: '#da532c',
80
+ theme_color: '#ffffff'
81
+ }
82
+ }
83
+ %>
84
+ ```
85
+
86
+
87
+
88
+ ### Render the Script
89
+ The Script partial includes the HTML script tags. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
90
+
91
+ The following code snippet does not load any JavaScript library.
92
+ ```erb
93
+ <%= render partial: 'repres/hyper_text/script' %>
94
+ ```
95
+
96
+ The following code snippet loads the latest jQuery.
97
+ ```erb
98
+ <%= render partial: 'repres/hyper_text/script', locals: { options: { jquery: true } } %>
99
+ ```
100
+
101
+ The following code snippet loads the jQuery with the given version.
102
+ ```erb
103
+ <%= render partial: 'repres/hyper_text/script', locals: { options: { jquery: { version: '2.2.0' } } } %>
104
+ ```
105
+
106
+ The following JavaScript libraries are switchable, and the version can be configurable:
107
+ - :modernizr
108
+ - :jquery
109
+
110
+
111
+
112
+ ### Render the Style
113
+ The Style partial includes the HTML style tags. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
114
+
115
+ The following code snippet does not load any CSS library.
116
+ ```erb
117
+ <%= render partial: 'repres/hyper_text/style' %>
118
+ ```
119
+
120
+ The following code snippet loads the latest Font Awesome.
121
+ ```erb
122
+ <%= render partial: 'repres/hyper_text/script', locals: { options: { :'font-awesome' => true } } %>
123
+ ```
124
+
125
+ The following code snippet loads the Font Awesome with the given version.
126
+ ```erb
127
+ <%= render partial: 'repres/hyper_text/style', locals: { options: { :'font-awesome' => { version: '4.4.0' } } } %>
128
+ ```
129
+
130
+ The following CSS libraries are switchable, and the version can be configurable:
131
+ - :'font-awesome'
132
+ - :buttons
133
+ - :'animate.css'
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Repres HyperText'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+ load 'rails/tasks/statistics.rake'
20
+
21
+
22
+
23
+ Bundler::GemHelper.install_tasks
24
+
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,2 @@
1
+ class Repres::HyperText::ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,11 @@
1
+ module Repres::HyperText::ApplicationHelper
2
+
3
+ def library_enabled?(name, options)
4
+ defined?(options) && options.try(:[], name).present?
5
+ end
6
+
7
+ def library_version(name, default_version, options)
8
+ defined?(options) ? options.try(:[], name).try(:[], :version)||default_version : default_version
9
+ end
10
+
11
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Bootstrap</title>
5
+ <%= stylesheet_link_tag "bootstrap/application", media: "all" %>
6
+ <%= javascript_include_tag "bootstrap/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,21 @@
1
+ <link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png">
2
+ <link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png">
3
+ <link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png">
4
+ <link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png">
5
+ <link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png">
6
+ <link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png">
7
+ <link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png">
8
+ <link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png">
9
+ <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png">
10
+ <link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
11
+ <link rel="icon" type="image/png" href="/favicons/favicon-194x194.png" sizes="194x194">
12
+ <link rel="icon" type="image/png" href="/favicons/favicon-96x96.png" sizes="96x96">
13
+ <link rel="icon" type="image/png" href="/favicons/android-chrome-192x192.png" sizes="192x192">
14
+ <link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
15
+ <link rel="manifest" href="/favicons/manifest.json">
16
+ <link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="<%= defined?(options) ? options[:safari_mask_icon_color]||'#5bbad5' : '#5bbad5' %>">
17
+ <meta name="msapplication-TileColor" content="<%= defined?(options) ? options[:microsoft_application_title_color]||'#da532c' : '#da532c' %>">
18
+ <meta name="msapplication-TileImage" content="/favicons/mstile-144x144.png">
19
+ <meta name="theme-color" content="<%= defined?(options) ? options[:theme_color]||'#ffffff' : '#ffffff' %>">
20
+ <link rel="icon" href="/favicon.ico" type="image/x-icon">
21
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
@@ -0,0 +1,6 @@
1
+ <meta charset="UTF-8">
2
+ <meta name="format-detection" content="telephone=no">
3
+ <meta name="msapplication-tap-highlight" content="no">
4
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height">
5
+ <meta name="renderer" content="webkit">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -0,0 +1,4 @@
1
+ <% options = defined?(options) ? options : nil %>
2
+
3
+ <%= javascript_include_tag "//cdn.bootcss.com/modernizr/#{library_version(:modernizr, '2.8.3', options)}/modernizr.min.js" if library_enabled?(:modernizr, options) %>
4
+ <%= javascript_include_tag "//cdn.bootcss.com/jquery/#{library_version(:jquery, '2.2.1', options)}/jquery.min.js" if library_enabled?(:jquery, options) %>
@@ -0,0 +1,5 @@
1
+ <% options = defined?(options) ? options : nil %>
2
+
3
+ <%= stylesheet_link_tag "//cdn.bootcss.com/font-awesome/#{library_version(:'font-awesome', '4.5.0', options)}/css/font-awesome.min.css", media: 'all' if library_enabled?(:'font-awesome', options) %>
4
+ <%= stylesheet_link_tag "//cdn.bootcss.com/Buttons/#{library_version(:buttons, '2.0.0', options)}/css/buttons.min.css", media: 'all' if library_enabled?(:buttons, options) %>
5
+ <%= stylesheet_link_tag "//cdn.bootcss.com/animate.css/#{library_version(:'animate.css', '3.5.1', options)}/animate.min.css", media: 'all' if library_enabled?(:'animate.css', options) %>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Repres::HyperText::Engine.routes.draw do
2
+ end
@@ -0,0 +1,11 @@
1
+ module Repres
2
+ module HyperText
3
+
4
+ class Engine < ::Rails::Engine
5
+
6
+ isolate_namespace Repres::HyperText
7
+
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Repres
2
+ module HyperText
3
+ VERSION = '1.0'.freeze
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ require 'repres/hyper_text/engine'
2
+
3
+ module Repres
4
+ module HyperText
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :hyper_text do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: repres-hyper_text
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Topbit Du
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ description: Repres (REsource PRESentation) is a series of resource representation
28
+ engines. The HyperText resource presentation engine includes HyperText-based resource
29
+ presentation templates & snippets. Repres (资源表现)是一系列的资源表现引擎。超文本资源表现引擎包括基于超文本的资源表现模版和片段。
30
+ email:
31
+ - topbit.du@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - MIT-LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - app/assets/javascripts/repres/hyper_text/application.js
40
+ - app/assets/stylesheets/repres/hyper_text/application.css
41
+ - app/controllers/repres/hyper_text/application_controller.rb
42
+ - app/helpers/repres/hyper_text/application_helper.rb
43
+ - app/views/layouts/repres/hyper_text/application.html.erb
44
+ - app/views/repres/hyper_text/_icon.html.erb
45
+ - app/views/repres/hyper_text/_meta.html.erb
46
+ - app/views/repres/hyper_text/_script.html.erb
47
+ - app/views/repres/hyper_text/_style.html.erb
48
+ - config/routes.rb
49
+ - lib/repres/hyper_text.rb
50
+ - lib/repres/hyper_text/engine.rb
51
+ - lib/repres/hyper_text/version.rb
52
+ - lib/tasks/hyper_text_tasks.rake
53
+ homepage: https://github.com/topbitdu/repres-hyper_text
54
+ licenses:
55
+ - MIT
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubyforge_project:
73
+ rubygems_version: 2.4.5.1
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: Repres HyperText Resource Presentation Engine Repres超文本资源表现引擎
77
+ test_files: []