weather-seven-rails 1.0.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.
@@ -0,0 +1,210 @@
1
+ /* FONT PATH
2
+ * -------------------------- */
3
+ //= depend_on_asset "Pe-icon-7-weather.eot"
4
+ //= depend_on_asset "Pe-icon-7-weather.woff"
5
+ //= depend_on_asset "Pe-icon-7-weather.ttf"
6
+ //= depend_on_asset "Pe-icon-7-weather.svg"
7
+ <% v = WeatherSeven::Rails::W7_VERSION %>
8
+ @font-face {
9
+ font-family: 'Pe-icon-7-weather';
10
+ src: url('<%= font_path('Pe-icon-7-weather.eot') %>?v=<%= v %>');
11
+ src: url('<%= font_path('Pe-icon-7-weather.eot') %>?#iefix&v=<%= v %>') format('embedded-opentype'), url('<%= font_path('Pe-icon-7-weather.woff') %>?v=<%= v %>') format('woff'), url('<%= font_path('Pe-icon-7-weather.ttf') %>?v=<%= v %>') format('truetype'), url('<%= font_path('Pe-icon-7-weather.svg') %>?v=<%= v %>#Pe-icon-7-weather') format('svg');
12
+ font-weight: normal;
13
+ font-style: normal;
14
+ }
15
+
16
+ [class^="pe-7w-"], [class*=" pe-7w-"] {
17
+ display: inline-block;
18
+ font-family: 'Pe-icon-7-weather';
19
+ speak: none;
20
+ font-style: normal;
21
+ font-weight: normal;
22
+ font-variant: normal;
23
+ text-transform: none;
24
+ line-height: 1;
25
+
26
+ /* Better Font Rendering =========== */
27
+ -webkit-font-smoothing: antialiased;
28
+ -moz-osx-font-smoothing: grayscale;
29
+ }
30
+
31
+ .pe-7w-wind:before {
32
+ content: "\e600";
33
+ }
34
+ .pe-7w-wind-sun:before {
35
+ content: "\e601";
36
+ }
37
+ .pe-7w-wind-moon:before {
38
+ content: "\e602";
39
+ }
40
+ .pe-7w-upload:before {
41
+ content: "\e603";
42
+ }
43
+ .pe-7w-umbrella:before {
44
+ content: "\e604";
45
+ }
46
+ .pe-7w-thermometer-full:before {
47
+ content: "\e605";
48
+ }
49
+ .pe-7w-thermometer-3-4:before {
50
+ content: "\e606";
51
+ }
52
+ .pe-7w-thermometer-1-4:before {
53
+ content: "\e607";
54
+ }
55
+ .pe-7w-thermometer-1-2:before {
56
+ content: "\e608";
57
+ }
58
+ .pe-7w-thermometer-0:before {
59
+ content: "\e609";
60
+ }
61
+ .pe-7w-sunset:before {
62
+ content: "\e60a";
63
+ }
64
+ .pe-7w-sunrise:before {
65
+ content: "\e60b";
66
+ }
67
+ .pe-7w-sun:before {
68
+ content: "\e60c";
69
+ }
70
+ .pe-7w-snow:before {
71
+ content: "\e60d";
72
+ }
73
+ .pe-7w-snow-sun:before {
74
+ content: "\e60e";
75
+ }
76
+ .pe-7w-snow-moon:before {
77
+ content: "\e60f";
78
+ }
79
+ .pe-7w-snow-alt:before {
80
+ content: "\e610";
81
+ }
82
+ .pe-7w-snow-alt-sun:before {
83
+ content: "\e611";
84
+ }
85
+ .pe-7w-snow-alt-moon:before {
86
+ content: "\e612";
87
+ }
88
+ .pe-7w-rain:before {
89
+ content: "\e613";
90
+ }
91
+ .pe-7w-rain-sun:before {
92
+ content: "\e614";
93
+ }
94
+ .pe-7w-rain-moon:before {
95
+ content: "\e615";
96
+ }
97
+ .pe-7w-rain-alt:before {
98
+ content: "\e616";
99
+ }
100
+ .pe-7w-rain-alt-sun:before {
101
+ content: "\e617";
102
+ }
103
+ .pe-7w-rain-alt-moon:before {
104
+ content: "\e618";
105
+ }
106
+ .pe-7w-moon:before {
107
+ content: "\e619";
108
+ }
109
+ .pe-7w-lightning:before {
110
+ content: "\e61a";
111
+ }
112
+ .pe-7w-lightning-sun:before {
113
+ content: "\e61b";
114
+ }
115
+ .pe-7w-lightning-rain:before {
116
+ content: "\e61c";
117
+ }
118
+ .pe-7w-lightning-rain-sun:before {
119
+ content: "\e61d";
120
+ }
121
+ .pe-7w-lightning-rain-moon:before {
122
+ content: "\e61e";
123
+ }
124
+ .pe-7w-lightning-moon:before {
125
+ content: "\e61f";
126
+ }
127
+ .pe-7w-light:before {
128
+ content: "\e620";
129
+ }
130
+ .pe-7w-hurricane:before {
131
+ content: "\e621";
132
+ }
133
+ .pe-7w-hail:before {
134
+ content: "\e622";
135
+ }
136
+ .pe-7w-hail-sun:before {
137
+ content: "\e623";
138
+ }
139
+ .pe-7w-hail-moon:before {
140
+ content: "\e624";
141
+ }
142
+ .pe-7w-fog:before {
143
+ content: "\e625";
144
+ }
145
+ .pe-7w-fog-sun:before {
146
+ content: "\e626";
147
+ }
148
+ .pe-7w-fog-moon:before {
149
+ content: "\e627";
150
+ }
151
+ .pe-7w-drizzle:before {
152
+ content: "\e628";
153
+ }
154
+ .pe-7w-drizzle-sun:before {
155
+ content: "\e629";
156
+ }
157
+ .pe-7w-drizzle-moon:before {
158
+ content: "\e62a";
159
+ }
160
+ .pe-7w-drizzle-alt:before {
161
+ content: "\e62b";
162
+ }
163
+ .pe-7w-drizzle-alt-sun:before {
164
+ content: "\e62c";
165
+ }
166
+ .pe-7w-drizzle-alt-moon:before {
167
+ content: "\e62d";
168
+ }
169
+ .pe-7w-download:before {
170
+ content: "\e62e";
171
+ }
172
+ .pe-7w-degree-farenheit:before {
173
+ content: "\e62f";
174
+ }
175
+ .pe-7w-degree-celcius:before {
176
+ content: "\e630";
177
+ }
178
+ .pe-7w-compass:before {
179
+ content: "\e631";
180
+ }
181
+ .pe-7w-compass-west:before {
182
+ content: "\e632";
183
+ }
184
+ .pe-7w-compass-south:before {
185
+ content: "\e633";
186
+ }
187
+ .pe-7w-compass-north:before {
188
+ content: "\e634";
189
+ }
190
+ .pe-7w-compass-east:before {
191
+ content: "\e635";
192
+ }
193
+ .pe-7w-cloud:before {
194
+ content: "\e636";
195
+ }
196
+ .pe-7w-cloud-wind:before {
197
+ content: "\e637";
198
+ }
199
+ .pe-7w-cloud-wind-sun:before {
200
+ content: "\e638";
201
+ }
202
+ .pe-7w-cloud-wind-moon:before {
203
+ content: "\e639";
204
+ }
205
+ .pe-7w-cloud-sun:before {
206
+ content: "\e63a";
207
+ }
208
+ .pe-7w-cloud-moon:before {
209
+ content: "\e63b";
210
+ }
@@ -0,0 +1,50 @@
1
+ module WeatherSeven
2
+ module Rails
3
+ module IconHelper
4
+ # Creates an icon tag given an icon name and possible icon
5
+ # modifiers.
6
+ #
7
+ # Examples
8
+ #
9
+ # w7_icon "wind"
10
+ # # => <i class="pe-7w-wind"></i>
11
+ #
12
+ # w7_icon "wind", class: "pull-left"
13
+ # # => <i class="pe-7w-wind pull-left"></i>
14
+ #
15
+ # w7_icon "wind", data: { id: 123 }
16
+ # # => <i class="pe-7w-wind" data-id="123"></i>
17
+ #
18
+ # content_tag(:li, w7_icon("wind", text: "Bulleted list item"))
19
+ # # => <li><i class="pe-7w-wind"></i> Bulleted list item</li>
20
+ def w7_icon(names = "wind", options = {})
21
+ classes = []
22
+ classes.concat Private.icon_names(names)
23
+ classes.concat Array(options.delete(:class))
24
+ text = options.delete(:text)
25
+ right_icon = options.delete(:right)
26
+ icon = content_tag(:i, nil, options.merge(:class => classes))
27
+ Private.icon_join(icon, text, right_icon)
28
+ end
29
+
30
+ module Private
31
+ extend ActionView::Helpers::OutputSafetyHelper
32
+
33
+ def self.icon_join(icon, text, reverse_order = false)
34
+ return icon if text.blank?
35
+ elements = [icon, ERB::Util.html_escape(text)]
36
+ elements.reverse! if reverse_order
37
+ safe_join(elements, " ")
38
+ end
39
+
40
+ def self.icon_names(names = [])
41
+ array_value(names).map { |n| "pe-7w-#{n}" }
42
+ end
43
+
44
+ def self.array_value(value = [])
45
+ value.is_a?(Array) ? value : value.to_s.split(/\s+/)
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,2 @@
1
+ require "weather-seven-rails/version"
2
+ require "weather-seven-rails/engine" if defined?(::Rails)
@@ -0,0 +1,6 @@
1
+ module WeatherSeven
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module WeatherSeven
2
+ module Rails
3
+ W7_VERSION = "1.0.0"
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
@@ -0,0 +1 @@
1
+ @import weather-seven
@@ -0,0 +1 @@
1
+ @import "weather-seven";
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require weather-seven
3
+ */
@@ -0,0 +1,2 @@
1
+ class PagesController < ActionController::Base
2
+ end
@@ -0,0 +1 @@
1
+ <%= w7_icon 'wind' %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,19 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # require "rails/all"
4
+ require "sprockets/railtie"
5
+
6
+ Bundler.require(:default, :development)
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ config.encoding = "utf-8"
11
+ config.assets.enabled = true
12
+ config.assets.version = '1.0'
13
+
14
+ # replacement for environments/*.rb
15
+ config.active_support.deprecation = :stderr
16
+ config.eager_load = false
17
+ config.active_support.test_order = :random rescue nil
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
8
+ Dummy::Application.config.secret_key_base = 'deadbeef' if Dummy::Application.config.respond_to?(:secret_key_base)
@@ -0,0 +1,3 @@
1
+ Dummy::Application.routes.draw do
2
+ get "/icons", :to => "pages#icons"
3
+ end
@@ -0,0 +1,122 @@
1
+ -------------------------------------------------------------------
2
+ WeatherSevenRailsTest: test_helpers_should_be_available_in_the_view
3
+ -------------------------------------------------------------------
4
+ Started GET "/icons" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
5
+ Processing by PagesController#icons as HTML
6
+ Rendered pages/icons.html.erb (1.5ms)
7
+ Completed 200 OK in 8ms (Views: 7.8ms)
8
+ --------------------------------------------------
9
+ WeatherSevenRailsTest: test_stylesheets_are_served
10
+ --------------------------------------------------
11
+ Started GET "/assets/weather-seven.css" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
12
+ --------------------------------------------------------------------
13
+ WeatherSevenRailsTest: test_stylesheet_is_available_in_a_scss_import
14
+ --------------------------------------------------------------------
15
+ Started GET "/assets/scss-import.css" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
16
+ --------------------------------------------------------------------
17
+ WeatherSevenRailsTest: test_stylesheet_is_available_in_a_sass_import
18
+ --------------------------------------------------------------------
19
+ Started GET "/assets/sass-import.css" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
20
+ ------------------------------------------------------------------------------
21
+ WeatherSevenRailsTest: test_stylesheet_is_available_in_a_css_sprockets_require
22
+ ------------------------------------------------------------------------------
23
+ Started GET "/assets/sprockets-require.css" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
24
+ ----------------------------------------------------------------------------------
25
+ WeatherSevenRailsTest: test_stylesheets_contain_asset_pipeline_references_to_fonts
26
+ ----------------------------------------------------------------------------------
27
+ Started GET "/assets/weather-seven.css" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
28
+ --------------------------------------------
29
+ WeatherSevenRailsTest: test_fonts_are_served
30
+ --------------------------------------------
31
+ Started GET "/assets/Pe-icon-7-weather.eot" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
32
+ Started GET "/assets/Pe-icon-7-weather.woff" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
33
+ Started GET "/assets/Pe-icon-7-weather.ttf" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
34
+ Started GET "/assets/Pe-icon-7-weather.svg" for 127.0.0.1 at 2015-10-26 00:47:07 -0400
35
+ --------------------------------------------
36
+ WeatherSevenRailsTest: test_engine_is_loaded
37
+ --------------------------------------------
38
+ ------------------------------------------------------------------------------
39
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_pull_it_all_together
40
+ ------------------------------------------------------------------------------
41
+ -------------------------------------------------------------------------------------------
42
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_render_different_individual_icons
43
+ -------------------------------------------------------------------------------------------
44
+ ------------------------------------------------------------------------------------------
45
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_with_no_args_should_render_an_wind_icon
46
+ ------------------------------------------------------------------------------------------
47
+ -----------------------------------------------------------------------------------
48
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_not_html_escape_safe_text
49
+ -----------------------------------------------------------------------------------
50
+ -----------------------------------------------------------------------------------
51
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_incorporate_a_text_suffix
52
+ -----------------------------------------------------------------------------------
53
+ ----------------------------------------------------------------------------------------
54
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_pass_all_other_options_through
55
+ ----------------------------------------------------------------------------------------
56
+ --------------------------------------------------------------------------
57
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_html_escape_text
58
+ --------------------------------------------------------------------------
59
+ ---------------------------------------------------------------------------------------------
60
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_incorporate_additional_class_styles
61
+ ---------------------------------------------------------------------------------------------
62
+ ----------------------------------------------------------------------------------
63
+ WeatherSevenRailsTest: test_stylesheets_contain_asset_pipeline_references_to_fonts
64
+ ----------------------------------------------------------------------------------
65
+ Started GET "/assets/weather-seven.css" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
66
+ ------------------------------------------------------------------------------
67
+ WeatherSevenRailsTest: test_stylesheet_is_available_in_a_css_sprockets_require
68
+ ------------------------------------------------------------------------------
69
+ Started GET "/assets/sprockets-require.css" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
70
+ --------------------------------------------------------------------
71
+ WeatherSevenRailsTest: test_stylesheet_is_available_in_a_scss_import
72
+ --------------------------------------------------------------------
73
+ Started GET "/assets/scss-import.css" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
74
+ --------------------------------------------
75
+ WeatherSevenRailsTest: test_engine_is_loaded
76
+ --------------------------------------------
77
+ -------------------------------------------------------------------
78
+ WeatherSevenRailsTest: test_helpers_should_be_available_in_the_view
79
+ -------------------------------------------------------------------
80
+ Started GET "/icons" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
81
+ Processing by PagesController#icons as HTML
82
+ Rendered pages/icons.html.erb (1.5ms)
83
+ Completed 200 OK in 6ms (Views: 6.2ms)
84
+ --------------------------------------------
85
+ WeatherSevenRailsTest: test_fonts_are_served
86
+ --------------------------------------------
87
+ Started GET "/assets/Pe-icon-7-weather.eot" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
88
+ Started GET "/assets/Pe-icon-7-weather.woff" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
89
+ Started GET "/assets/Pe-icon-7-weather.ttf" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
90
+ Started GET "/assets/Pe-icon-7-weather.svg" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
91
+ --------------------------------------------------
92
+ WeatherSevenRailsTest: test_stylesheets_are_served
93
+ --------------------------------------------------
94
+ Started GET "/assets/weather-seven.css" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
95
+ --------------------------------------------------------------------
96
+ WeatherSevenRailsTest: test_stylesheet_is_available_in_a_sass_import
97
+ --------------------------------------------------------------------
98
+ Started GET "/assets/sass-import.css" for 127.0.0.1 at 2015-10-26 00:47:55 -0400
99
+ -----------------------------------------------------------------------------------
100
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_incorporate_a_text_suffix
101
+ -----------------------------------------------------------------------------------
102
+ ------------------------------------------------------------------------------
103
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_pull_it_all_together
104
+ ------------------------------------------------------------------------------
105
+ --------------------------------------------------------------------------
106
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_html_escape_text
107
+ --------------------------------------------------------------------------
108
+ -----------------------------------------------------------------------------------
109
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_not_html_escape_safe_text
110
+ -----------------------------------------------------------------------------------
111
+ ------------------------------------------------------------------------------------------
112
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_with_no_args_should_render_an_wind_icon
113
+ ------------------------------------------------------------------------------------------
114
+ -------------------------------------------------------------------------------------------
115
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_render_different_individual_icons
116
+ -------------------------------------------------------------------------------------------
117
+ ----------------------------------------------------------------------------------------
118
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_pass_all_other_options_through
119
+ ----------------------------------------------------------------------------------------
120
+ ---------------------------------------------------------------------------------------------
121
+ WeatherSeven::Rails::IconHelperTest: test_#w7_icon_should_incorporate_additional_class_styles
122
+ ---------------------------------------------------------------------------------------------