seqseq 0.1.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.
- data/MIT-LICENSE +20 -0
- data/README.md +47 -0
- data/Rakefile +20 -0
- data/lib/generators/seqseq/install_generator.rb +35 -0
- data/lib/generators/seqseq/templates/install_seqseq.rb +19 -0
- data/lib/generators/seqseq/templates/seqseq.rb +3 -0
- data/lib/seqseq.rb +32 -0
- data/lib/seqseq/version.rb +3 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/auto_sequence.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +65 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +49 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/db/migrate/20130929095519_install_seqseq.rb +19 -0
- data/test/dummy/db/schema.rb +28 -0
- data/test/dummy/log/development.log +178 -0
- data/test/dummy/log/test.log +3239 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/seqseq_test.rb +46 -0
- data/test/test_helper.rb +15 -0
- metadata +161 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/seqseq_test.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SeqseqTest < ActiveSupport::TestCase
|
4
|
+
test 'module' do
|
5
|
+
assert_kind_of Module, SeqSeq
|
6
|
+
assert_kind_of Module, SeqSeq::Base
|
7
|
+
end
|
8
|
+
|
9
|
+
test 'version' do
|
10
|
+
assert SeqSeq::VERSION.present?
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'next_val' do
|
14
|
+
[:seq_1, :seq_2, :seq_3].each do |seq|
|
15
|
+
assert_equal AutoSequence.next_val(seq, 1), 1
|
16
|
+
assert_equal AutoSequence.next_val(seq, 1), 2
|
17
|
+
assert_equal AutoSequence.next_val(seq, 1), 3
|
18
|
+
|
19
|
+
assert_equal AutoSequence.next_val(seq, 'x'), 1
|
20
|
+
assert_equal AutoSequence.next_val(seq, 'x'), 2
|
21
|
+
assert_equal AutoSequence.next_val(seq, 'x'), 3
|
22
|
+
|
23
|
+
assert_equal AutoSequence.next_val(seq, 1), 4
|
24
|
+
assert_equal AutoSequence.next_val(seq, 1), 5
|
25
|
+
assert_equal AutoSequence.next_val(seq, 1), 6
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
test 'start_with' do
|
30
|
+
assert_equal AutoSequence.next_val(:seq, 1, start_with: 11), 11
|
31
|
+
assert_equal AutoSequence.next_val(:seq, 1, start_with: 21), 12
|
32
|
+
assert_equal AutoSequence.next_val(:seq, 1), 13
|
33
|
+
end
|
34
|
+
|
35
|
+
test 'step_by' do
|
36
|
+
assert_equal AutoSequence.next_val(:seq, 1, step_by: 10), 1
|
37
|
+
assert_equal AutoSequence.next_val(:seq, 1, step_by: 20), 11
|
38
|
+
assert_equal AutoSequence.next_val(:seq, 1), 21
|
39
|
+
end
|
40
|
+
|
41
|
+
test 'start_with & step_by' do
|
42
|
+
assert_equal AutoSequence.next_val(:seq, 1, start_with: 10, step_by: 5), 10
|
43
|
+
assert_equal AutoSequence.next_val(:seq, 1, start_with: 20, step_by: 1), 15
|
44
|
+
assert_equal AutoSequence.next_val(:seq, 1), 20
|
45
|
+
end
|
46
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: seqseq
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Szetobo
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-09-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
type: :runtime
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.0.0
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ! '>='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 3.0.0
|
29
|
+
prerelease: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: pg
|
32
|
+
type: :development
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
prerelease: false
|
46
|
+
description: A sequence number generator
|
47
|
+
email:
|
48
|
+
- szetobo@gmail.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- lib/generators/seqseq/install_generator.rb
|
54
|
+
- lib/generators/seqseq/templates/install_seqseq.rb
|
55
|
+
- lib/generators/seqseq/templates/seqseq.rb
|
56
|
+
- lib/seqseq.rb
|
57
|
+
- lib/seqseq/version.rb
|
58
|
+
- MIT-LICENSE
|
59
|
+
- Rakefile
|
60
|
+
- README.md
|
61
|
+
- test/test_helper.rb
|
62
|
+
- test/seqseq_test.rb
|
63
|
+
- test/dummy/log/test.log
|
64
|
+
- test/dummy/log/development.log
|
65
|
+
- test/dummy/config/application.rb
|
66
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
67
|
+
- test/dummy/config/initializers/secret_token.rb
|
68
|
+
- test/dummy/config/initializers/mime_types.rb
|
69
|
+
- test/dummy/config/initializers/inflections.rb
|
70
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
71
|
+
- test/dummy/config/initializers/session_store.rb
|
72
|
+
- test/dummy/config/locales/en.yml
|
73
|
+
- test/dummy/config/environment.rb
|
74
|
+
- test/dummy/config/database.yml
|
75
|
+
- test/dummy/config/environments/development.rb
|
76
|
+
- test/dummy/config/environments/production.rb
|
77
|
+
- test/dummy/config/environments/test.rb
|
78
|
+
- test/dummy/config/boot.rb
|
79
|
+
- test/dummy/config/routes.rb
|
80
|
+
- test/dummy/README.rdoc
|
81
|
+
- test/dummy/Rakefile
|
82
|
+
- test/dummy/app/views/layouts/application.html.erb
|
83
|
+
- test/dummy/app/helpers/application_helper.rb
|
84
|
+
- test/dummy/app/assets/stylesheets/application.css
|
85
|
+
- test/dummy/app/assets/javascripts/application.js
|
86
|
+
- test/dummy/app/controllers/application_controller.rb
|
87
|
+
- test/dummy/app/models/auto_sequence.rb
|
88
|
+
- test/dummy/script/rails
|
89
|
+
- test/dummy/config.ru
|
90
|
+
- test/dummy/db/schema.rb
|
91
|
+
- test/dummy/db/migrate/20130929095519_install_seqseq.rb
|
92
|
+
- test/dummy/public/favicon.ico
|
93
|
+
- test/dummy/public/404.html
|
94
|
+
- test/dummy/public/500.html
|
95
|
+
- test/dummy/public/422.html
|
96
|
+
homepage: https://github.com/szetobo/seqseq
|
97
|
+
licenses: []
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
hash: -714985939293843878
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
hash: -714985939293843878
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 1.8.23
|
123
|
+
signing_key:
|
124
|
+
specification_version: 3
|
125
|
+
summary: A sequence number generator
|
126
|
+
test_files:
|
127
|
+
- test/test_helper.rb
|
128
|
+
- test/seqseq_test.rb
|
129
|
+
- test/dummy/log/test.log
|
130
|
+
- test/dummy/log/development.log
|
131
|
+
- test/dummy/config/application.rb
|
132
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
133
|
+
- test/dummy/config/initializers/secret_token.rb
|
134
|
+
- test/dummy/config/initializers/mime_types.rb
|
135
|
+
- test/dummy/config/initializers/inflections.rb
|
136
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
137
|
+
- test/dummy/config/initializers/session_store.rb
|
138
|
+
- test/dummy/config/locales/en.yml
|
139
|
+
- test/dummy/config/environment.rb
|
140
|
+
- test/dummy/config/database.yml
|
141
|
+
- test/dummy/config/environments/development.rb
|
142
|
+
- test/dummy/config/environments/production.rb
|
143
|
+
- test/dummy/config/environments/test.rb
|
144
|
+
- test/dummy/config/boot.rb
|
145
|
+
- test/dummy/config/routes.rb
|
146
|
+
- test/dummy/README.rdoc
|
147
|
+
- test/dummy/Rakefile
|
148
|
+
- test/dummy/app/views/layouts/application.html.erb
|
149
|
+
- test/dummy/app/helpers/application_helper.rb
|
150
|
+
- test/dummy/app/assets/stylesheets/application.css
|
151
|
+
- test/dummy/app/assets/javascripts/application.js
|
152
|
+
- test/dummy/app/controllers/application_controller.rb
|
153
|
+
- test/dummy/app/models/auto_sequence.rb
|
154
|
+
- test/dummy/script/rails
|
155
|
+
- test/dummy/config.ru
|
156
|
+
- test/dummy/db/schema.rb
|
157
|
+
- test/dummy/db/migrate/20130929095519_install_seqseq.rb
|
158
|
+
- test/dummy/public/favicon.ico
|
159
|
+
- test/dummy/public/404.html
|
160
|
+
- test/dummy/public/500.html
|
161
|
+
- test/dummy/public/422.html
|