rqrcode-rails3 0.1.0 → 0.1.1

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.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem "rails", ">= 3.0.0"
4
- gem "capybara" #, ">= 0.4.0"
4
+ gem "capybara", ">= 0.4.0"
5
5
  gem "sqlite3"
6
6
 
7
7
  gem "rqrcode"
data/README.rdoc CHANGED
@@ -20,6 +20,11 @@ In your controller actions, you can return a QRCode that links to the current pa
20
20
  format.svg { render :qrcode => request.url }
21
21
  format.png { render :qrcode => request.url }
22
22
  end
23
+
24
+ ----------------------------------------
25
+
26
+ This project was inspired by the first chapter in José Valim's book "Crafting Rails Applications."
27
+ QR Codes are encoded by 'rqrcode' [https://github.com/whomwah/rqrcode]
23
28
 
24
29
  ----------------------------------------
25
30
 
data/Rakefile CHANGED
@@ -22,7 +22,7 @@ task :default => :test
22
22
 
23
23
  Rake::RDocTask.new(:rdoc) do |rdoc|
24
24
  rdoc.rdoc_dir = 'rdoc'
25
- rdoc.title = 'Rqrcode-svg'
25
+ rdoc.title = 'rqrcode-rails3'
26
26
  rdoc.options << '--line-numbers' << '--inline-source'
27
27
  rdoc.rdoc_files.include('README.rdoc')
28
28
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -1,4 +1,4 @@
1
- require "action_controller"
1
+ require 'action_controller'
2
2
  require 'rqrcode'
3
3
  require 'rqrcode_rails3/renderers/svg.rb'
4
4
 
@@ -19,13 +19,11 @@ module RQRCode
19
19
  qrcode.modules.each_index do |r|
20
20
  y = c*11 + offset
21
21
  x = r*11 + offset
22
- row = %{<rect width="11" height="11" x="#{x}" y="#{y}" style="fill:#000"/>}
23
- col = options[:fill] ? %{<rect width="11" height="11" x="#{x}" y="#{y}" style="fill:#fff"/>} : ""
24
- if qrcode.is_dark(c,r)
25
- tmp << row
26
- else
27
- tmp << col
28
- end
22
+
23
+ next unless qrcode.is_dark(c, r) || options[:fill]
24
+
25
+ color = qrcode.is_dark(c, r) ? "000" : "fff"
26
+ tmp << %{<rect width="11" height="11" x="#{x}" y="#{y}" style="fill:##{color}"/>}
29
27
  end
30
28
  result << tmp.join
31
29
  end
metadata CHANGED
@@ -1,26 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rqrcode-rails3
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
- authors: []
13
-
12
+ authors:
13
+ - Sam Vincent
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-21 00:00:00 -07:00
18
+ date: 2011-05-22 00:00:00 -07:00
19
19
  default_executable:
20
- dependencies: []
21
-
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rqrcode
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 21
30
+ segments:
31
+ - 0
32
+ - 3
33
+ - 3
34
+ version: 0.3.3
35
+ type: :runtime
36
+ version_requirements: *id001
22
37
  description: Render QR Codes with Rails 3
23
- email:
38
+ email: sam.vincent@mac.com
24
39
  executables: []
25
40
 
26
41
  extensions: []
@@ -35,7 +50,7 @@ files:
35
50
  - Gemfile
36
51
  - README.rdoc
37
52
  has_rdoc: true
38
- homepage:
53
+ homepage: http://github.com/samvincent/rqrcode-rails3
39
54
  licenses: []
40
55
 
41
56
  post_install_message: