jap_mag 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/app/helpers/jap_mag_widgets_helper.rb +1 -1
- data/lib/jap_mag/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad7860047ecbc2f0eb308c5c14e8e07f9de20953f5dd711c2f8e1814e7cadeca
|
4
|
+
data.tar.gz: 434a1f22e88e06163adc8e203b1ea5ae59ca097feed8b2a86e339b0bd1540a6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23c4a705759b652492b56e1f3570f166707bddf2e74a4c42f52224e020c2696657d2a705d421177015586a22d23d7bc4ccc8b8525d9560db6c5e5bd6b03d55d2
|
7
|
+
data.tar.gz: 15074ed2ba030db699231549944d3108bb37c116ee971df6102f8abfa940af4d424c2e7a4e0ca0a54d8ec2bd56a4c4a4cbfb5afe7ca0e8502b15edab6ab1e518
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Introduction
|
2
2
|
|
3
|
-
JapMag is a collection of frequently-used Rails controller methods and
|
3
|
+
JapMag is a collection of frequently-used Rails controller methods, helpers, Javascript functions and SASS mixins. It helps quickly bootstrap a Rails app.
|
4
|
+
|
5
|
+
For example, [current_controller_action_in?](https://github.com/felixding/JapMag/blob/master/lib/jap_mag.rb#L38) is a helper that checks if current request.controller and request.action match with a set of given rules. You can then for example show or hide certain things on your app depending if it matches or not.
|
6
|
+
|
7
|
+
Another example is [retina_image_tag](https://github.com/felixding/JapMag/blob/master/app/helpers/jap_mag_widgets_helper.rb#L164) which can easily generate HTML `img` tags for Retina/Non-retina screens. It also helps you deal with localized images.
|
8
|
+
|
9
|
+
This project was first created in 2012.
|
4
10
|
|
5
11
|
## Installation & Usage
|
6
12
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module JapMagWidgetsHelper
|
2
2
|
def is_mobile_device?
|
3
3
|
mobile_user_agents = 'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|webos|amoi|novarra|cdm|alcatel|pocket|iphone|mobileexplorer|mobile'
|
4
|
-
request.user_agent.to_s.downcase =~ Regexp.new(mobile_user_agents)
|
4
|
+
(request.user_agent.to_s.downcase =~ Regexp.new(mobile_user_agents)) != nil
|
5
5
|
end
|
6
6
|
|
7
7
|
def get_body_class
|
data/lib/jap_mag/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jap_mag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DING Yu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: will_paginate
|
@@ -72,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
|
76
|
-
rubygems_version: 2.7.7
|
75
|
+
rubygems_version: 3.1.4
|
77
76
|
signing_key:
|
78
77
|
specification_version: 4
|
79
78
|
summary: jap_mag-
|