enju_barcode 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- Copyright 2011 YOURNAME
1
+ Copyright 2012 Kosuke Tanabe
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ end
14
14
 
15
15
  RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'EnjuPurchaseRequest'
17
+ rdoc.title = 'EnjuBarcode'
18
18
  rdoc.options << '--line-numbers'
19
19
  rdoc.rdoc_files.include('README.rdoc')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -43,3 +43,14 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
43
43
  end
44
44
 
45
45
  task :default => :spec
46
+ require 'rake/testtask'
47
+
48
+ Rake::TestTask.new(:test) do |t|
49
+ t.libs << 'lib'
50
+ t.libs << 'test'
51
+ t.pattern = 'test/**/*_test.rb'
52
+ t.verbose = false
53
+ end
54
+
55
+
56
+ task :default => :test
@@ -68,7 +68,7 @@ class BarcodesController < ApplicationController
68
68
  if @barcode.update_attributes(params[:barcode])
69
69
  flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.barcode'))
70
70
  format.html { redirect_to(@barcode) }
71
- format.json { head :ok }
71
+ format.json { head :no_content }
72
72
  else
73
73
  format.html { render :action => "edit" }
74
74
  format.json { render :json => @barcode.errors, :status => :unprocessable_entity }
@@ -82,8 +82,8 @@ class BarcodesController < ApplicationController
82
82
  @barcode.destroy
83
83
 
84
84
  respond_to do |format|
85
- format.html { redirect_to(barcodes_url) }
86
- format.json { head :ok }
85
+ format.html { redirect_to barcodes_url }
86
+ format.json { head :no_content }
87
87
  end
88
88
  end
89
89
  end
@@ -3,8 +3,7 @@ require 'barby/barcode/code_39'
3
3
  require 'barby/outputter/svg_outputter'
4
4
 
5
5
  class Barcode < ActiveRecord::Base
6
- belongs_to :barcodable, :polymorphic => true
7
-
6
+ attr_accessible :code_word, :data
8
7
  validates_presence_of :code_word
9
8
  before_save :generate_barcode
10
9
 
@@ -22,3 +21,14 @@ class Barcode < ActiveRecord::Base
22
21
  true
23
22
  end
24
23
  end
24
+ # == Schema Information
25
+ #
26
+ # Table name: barcodes
27
+ #
28
+ # id :integer not null, primary key
29
+ # code_word :string(255)
30
+ # data :binary
31
+ # created_at :datetime not null
32
+ # updated_at :datetime not null
33
+ #
34
+
@@ -3,6 +3,6 @@ require 'cancan'
3
3
  require 'will_paginate'
4
4
 
5
5
  module EnjuBarcode
6
- class Engine < Rails::Engine
6
+ class Engine < ::Rails::Engine
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuBarcode
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -92,10 +92,6 @@ Devise.setup do |config|
92
92
  # If true, extends the user's remember period when remembered via cookie.
93
93
  # config.extend_remember_period = false
94
94
 
95
- # If true, uses the password salt as remember token. This should be turned
96
- # to false if you are not using database authenticatable.
97
- config.use_salt_as_remember_token = true
98
-
99
95
  # Options to be passed to the created cookie. For instance, you can set
100
96
  # :secure => true in order to force SSL only cookies.
101
97
  # config.cookie_options = {}
@@ -1,19 +1,40 @@
1
1
  class AddDeviseToUsers < ActiveRecord::Migration
2
2
  def self.up
3
3
  change_table(:users) do |t|
4
- t.database_authenticatable :null => false
5
- t.recoverable
6
- t.rememberable
7
- t.trackable
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
8
7
 
9
- # t.encryptable
10
- # t.confirmable
11
- # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
12
- # t.token_authenticatable
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
13
11
 
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
14
 
15
- # Uncomment below if timestamps were not included in your original model.
16
- # t.timestamps
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Encryptable
23
+ t.string :password_salt
24
+
25
+ ## Confirmable
26
+ t.string :confirmation_token
27
+ t.datetime :confirmed_at
28
+ t.datetime :confirmation_sent_at
29
+ t.string :unconfirmed_email # Only if using reconfirmable
30
+
31
+ ## Lockable
32
+ t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
33
+ t.string :unlock_token # Only if unlock strategy is :email or :both
34
+ t.datetime :locked_at
35
+
36
+ # Token authenticatable
37
+ t.string :authentication_token
17
38
  end
18
39
 
19
40
  add_index :users, :email #, :unique => true
@@ -42,18 +42,27 @@ ActiveRecord::Schema.define(:version => 20111201163718) do
42
42
  t.string "username"
43
43
  t.text "note"
44
44
  t.string "locale"
45
- t.datetime "created_at", :null => false
46
- t.datetime "updated_at", :null => false
47
- t.string "email", :default => "", :null => false
48
- t.string "encrypted_password", :limit => 128, :default => "", :null => false
45
+ t.datetime "created_at", :null => false
46
+ t.datetime "updated_at", :null => false
47
+ t.string "email", :default => "", :null => false
48
+ t.string "encrypted_password", :default => "", :null => false
49
49
  t.string "reset_password_token"
50
50
  t.datetime "reset_password_sent_at"
51
51
  t.datetime "remember_created_at"
52
- t.integer "sign_in_count", :default => 0
52
+ t.integer "sign_in_count", :default => 0
53
53
  t.datetime "current_sign_in_at"
54
54
  t.datetime "last_sign_in_at"
55
55
  t.string "current_sign_in_ip"
56
56
  t.string "last_sign_in_ip"
57
+ t.string "password_salt"
58
+ t.string "confirmation_token"
59
+ t.datetime "confirmed_at"
60
+ t.datetime "confirmation_sent_at"
61
+ t.string "unconfirmed_email"
62
+ t.integer "failed_attempts", :default => 0
63
+ t.string "unlock_token"
64
+ t.datetime "locked_at"
65
+ t.string "authentication_token"
57
66
  end
58
67
 
59
68
  add_index "users", ["email"], :name => "index_users_on_email"
Binary file
@@ -7,3 +7,14 @@ barcode_00001:
7
7
  barcode_00002:
8
8
  data:
9
9
  code_word: bbbbbb
10
+ # == Schema Information
11
+ #
12
+ # Table name: barcodes
13
+ #
14
+ # id :integer not null, primary key
15
+ # code_word :string(255)
16
+ # data :binary
17
+ # created_at :datetime not null
18
+ # updated_at :datetime not null
19
+ #
20
+
@@ -2,6 +2,7 @@
2
2
  ENV["RAILS_ENV"] ||= 'test'
3
3
  require File.expand_path("../dummy/config/environment", __FILE__)
4
4
  require 'rspec/rails'
5
+ require 'factory_girl'
5
6
 
6
7
  # Requires supporting ruby files with custom matchers and macros, etc,
7
8
  # in spec/support/ and its subdirectories.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_barcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-13 00:00:00.000000000 Z
12
+ date: 2012-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70356382701360 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '3.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70356382701360
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.2'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: barby
27
- requirement: &70356382700860 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0.5'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70356382700860
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '0.5'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rqrcode
38
- requirement: &70356382700480 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70356382700480
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: devise
49
- requirement: &70356382700020 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *70356382700020
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: cancan
60
- requirement: &70356382699600 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :runtime
67
87
  prerelease: false
68
- version_requirements: *70356382699600
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: will_paginate
71
- requirement: &70356382699180 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: '0'
77
102
  type: :runtime
78
103
  prerelease: false
79
- version_requirements: *70356382699180
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: sqlite3
82
- requirement: &70356382698760 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,10 +117,31 @@ dependencies:
87
117
  version: '0'
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *70356382698760
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: rspec-rails
93
- requirement: &70356382698340 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: factory_girl_rails
144
+ requirement: !ruby/object:Gem::Requirement
94
145
  none: false
95
146
  requirements:
96
147
  - - ! '>='
@@ -98,7 +149,12 @@ dependencies:
98
149
  version: '0'
99
150
  type: :development
100
151
  prerelease: false
101
- version_requirements: *70356382698340
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
102
158
  description: barcode generator for Next-L Enju
103
159
  email:
104
160
  - tanabe@mwr.mediacom.keio.ac.jp
@@ -161,6 +217,7 @@ files:
161
217
  - spec/dummy/config/locales/en.yml
162
218
  - spec/dummy/config/routes.rb
163
219
  - spec/dummy/config.ru
220
+ - spec/dummy/db/development.sqlite3
164
221
  - spec/dummy/db/migrate/20111201121844_create_roles.rb
165
222
  - spec/dummy/db/migrate/20111201155456_create_users.rb
166
223
  - spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb
@@ -202,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
259
  version: '0'
203
260
  requirements: []
204
261
  rubyforge_project:
205
- rubygems_version: 1.8.11
262
+ rubygems_version: 1.8.23
206
263
  signing_key:
207
264
  specification_version: 3
208
265
  summary: enju_barcode plugin
@@ -238,6 +295,7 @@ test_files:
238
295
  - spec/dummy/config/locales/en.yml
239
296
  - spec/dummy/config/routes.rb
240
297
  - spec/dummy/config.ru
298
+ - spec/dummy/db/development.sqlite3
241
299
  - spec/dummy/db/migrate/20111201121844_create_roles.rb
242
300
  - spec/dummy/db/migrate/20111201155456_create_users.rb
243
301
  - spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb