mobile_rails 0.0.1.alpha → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## v0.0.1
2
+
3
+ * init release
@@ -9,6 +9,9 @@ DESC
9
9
  initializer("mobile_rails.rb") do
10
10
  'Mime::Type.register_alias "text/html", :mobile'
11
11
  end
12
+ application(nil, :env => "production") do
13
+ "config.assets.precompile += %w(mobile.css mobile.js)"
14
+ end
12
15
  end
13
16
  end
14
17
  end
@@ -6,11 +6,18 @@ module MobileRails
6
6
  end
7
7
 
8
8
  def mobile_layout
9
- mobile? ? "mobile" : 'application'
9
+ (mobile? && mobile_session?) ? "mobile" : 'application'
10
10
  end
11
11
 
12
12
  def set_mobile_request
13
- request.format = :mobile if mobile?
13
+ if mobile?
14
+ session[:mobile] = true if session[:mobile].nil?
15
+ request.format = :mobile if mobile_session?
16
+ end
17
+ end
18
+
19
+ def mobile_session?
20
+ session[:mobile] == true
14
21
  end
15
22
  end
16
23
  module ClassMethods
@@ -1,3 +1,3 @@
1
1
  module MobileRails
2
- VERSION = "0.0.1.alpha"
2
+ VERSION = "0.0.1"
3
3
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobile_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
5
- prerelease: 6
4
+ version: 0.0.1
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Hisea
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-12 00:00:00.000000000Z
12
+ date: 2011-12-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70138587269780 !ruby/object:Gem::Requirement
16
+ requirement: &70191330651940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70138587269780
24
+ version_requirements: *70191330651940
25
25
  description: Gem for easy creation of mobile enabled rails app.
26
26
  email:
27
27
  - zyinghai@gmail.com
@@ -31,6 +31,7 @@ extra_rdoc_files: []
31
31
  files:
32
32
  - .gitignore
33
33
  - .rspec
34
+ - CHANGELOG.md
34
35
  - Gemfile
35
36
  - MIT-LICENSE
36
37
  - README
@@ -57,9 +58,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
58
  required_rubygems_version: !ruby/object:Gem::Requirement
58
59
  none: false
59
60
  requirements:
60
- - - ! '>'
61
+ - - ! '>='
61
62
  - !ruby/object:Gem::Version
62
- version: 1.3.1
63
+ version: '0'
63
64
  requirements: []
64
65
  rubyforge_project: mobile_rails
65
66
  rubygems_version: 1.8.6