hit_counter 0.1.1 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/task.md +21 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +31 -0
  7. data/.github/dependabot.yml +11 -0
  8. data/.github/workflows/test.yml +42 -0
  9. data/.gitignore +8 -0
  10. data/.simplecov +15 -0
  11. data/CODE_OF_CONDUCT.md +10 -0
  12. data/CONTRIBUTING.md +34 -0
  13. data/Gemfile +12 -12
  14. data/LICENSE.txt +17 -11
  15. data/README.md +120 -0
  16. data/Rakefile +15 -40
  17. data/SECURITY.md +16 -0
  18. data/certs/ivanoblomov.pem +25 -0
  19. data/config/initializers/mime_types.rb +3 -1
  20. data/config/mongoid.yml +6 -0
  21. data/hit_counter.gemspec +20 -87
  22. data/lib/hit_counter.rb +91 -85
  23. data/lib/tasks/install.rake +6 -0
  24. data/lib/version.rb +7 -0
  25. data/public/images/digits/celtic/0.png +0 -0
  26. data/public/images/digits/celtic/1.png +0 -0
  27. data/public/images/digits/celtic/2.png +0 -0
  28. data/public/images/digits/celtic/3.png +0 -0
  29. data/public/images/digits/celtic/4.png +0 -0
  30. data/public/images/digits/celtic/5.png +0 -0
  31. data/public/images/digits/celtic/6.png +0 -0
  32. data/public/images/digits/celtic/7.png +0 -0
  33. data/public/images/digits/celtic/8.png +0 -0
  34. data/public/images/digits/celtic/9.png +0 -0
  35. data/public/images/digits/odometer/0.png +0 -0
  36. data/public/images/digits/odometer/1.png +0 -0
  37. data/public/images/digits/odometer/2.png +0 -0
  38. data/public/images/digits/odometer/3.png +0 -0
  39. data/public/images/digits/odometer/4.png +0 -0
  40. data/public/images/digits/odometer/5.png +0 -0
  41. data/public/images/digits/odometer/6.png +0 -0
  42. data/public/images/digits/odometer/7.png +0 -0
  43. data/public/images/digits/odometer/8.png +0 -0
  44. data/public/images/digits/odometer/9.png +0 -0
  45. data/public/images/digits/scout/0.png +0 -0
  46. data/public/images/digits/scout/1.png +0 -0
  47. data/public/images/digits/scout/2.png +0 -0
  48. data/public/images/digits/scout/3.png +0 -0
  49. data/public/images/digits/scout/4.png +0 -0
  50. data/public/images/digits/scout/5.png +0 -0
  51. data/public/images/digits/scout/6.png +0 -0
  52. data/public/images/digits/scout/7.png +0 -0
  53. data/public/images/digits/scout/8.png +0 -0
  54. data/public/images/digits/scout/9.png +0 -0
  55. data/spec/lib/hit_counter_spec.rb +110 -69
  56. data/spec/spec_helper.rb +52 -3
  57. data.tar.gz.sig +0 -0
  58. metadata +157 -148
  59. metadata.gz.sig +0 -0
  60. data/README.rdoc +0 -82
  61. data/VERSION +0 -1
  62. data/public/images/digits/celtic/0.gif +0 -0
  63. data/public/images/digits/celtic/1.gif +0 -0
  64. data/public/images/digits/celtic/2.gif +0 -0
  65. data/public/images/digits/celtic/3.gif +0 -0
  66. data/public/images/digits/celtic/4.gif +0 -0
  67. data/public/images/digits/celtic/5.gif +0 -0
  68. data/public/images/digits/celtic/6.gif +0 -0
  69. data/public/images/digits/celtic/7.gif +0 -0
  70. data/public/images/digits/celtic/8.gif +0 -0
  71. data/public/images/digits/celtic/9.gif +0 -0
  72. data/public/images/digits/odometer/0.gif +0 -0
  73. data/public/images/digits/odometer/1.gif +0 -0
  74. data/public/images/digits/odometer/2.gif +0 -0
  75. data/public/images/digits/odometer/3.gif +0 -0
  76. data/public/images/digits/odometer/4.gif +0 -0
  77. data/public/images/digits/odometer/5.gif +0 -0
  78. data/public/images/digits/odometer/6.gif +0 -0
  79. data/public/images/digits/odometer/7.gif +0 -0
  80. data/public/images/digits/odometer/8.gif +0 -0
  81. data/public/images/digits/odometer/9.gif +0 -0
  82. data/public/images/digits/scout/0.gif +0 -0
  83. data/public/images/digits/scout/1.gif +0 -0
  84. data/public/images/digits/scout/2.gif +0 -0
  85. data/public/images/digits/scout/3.gif +0 -0
  86. data/public/images/digits/scout/4.gif +0 -0
  87. data/public/images/digits/scout/5.gif +0 -0
  88. data/public/images/digits/scout/6.gif +0 -0
  89. data/public/images/digits/scout/7.gif +0 -0
  90. data/public/images/digits/scout/8.gif +0 -0
  91. data/public/images/digits/scout/9.gif +0 -0
metadata CHANGED
@@ -1,178 +1,187 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hit_counter
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Roderick Monje
14
- autorequire:
8
+ autorequire:
15
9
  bindir: bin
16
- cert_chain: []
17
-
18
- date: 2011-09-25 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIEQDCCAqigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpyb2Qv
14
+ REM9Zm92ZWFjZW50cmFsL0RDPWNvbTAeFw0yMTExMTUwMzEwMTRaFw0yMjExMTUw
15
+ MzEwMTRaMCUxIzAhBgNVBAMMGnJvZC9EQz1mb3ZlYWNlbnRyYWwvREM9Y29tMIIB
16
+ ojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAsMm8RdCTuhYTnbH5a8pesLYn
17
+ BD7cLPkeNfPWp8ohGVXL3988lRBYHwI/LRhxKXncmwmjYFWjuyR1m3e+EgmpBO3e
18
+ gCn4G9paWlwvPF+dSBF4pjhPtYBSXMFDfoeUTyHuNCcQOFJUMSAxo1pg9S9KvslC
19
+ Y1fpstOJtVnUjoeT8BRQAqV0WZuzFhgj74oSoHP/ETEd7Uzw/ST/kKgtNGcxoIYu
20
+ FEqAfEsqEp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jF+rz7x1lBqEU
36
+ -----END CERTIFICATE-----
37
+ date: 2021-12-08 00:00:00.000000000 Z
38
+ dependencies:
39
+ - !ruby/object:Gem::Dependency
21
40
  name: addressable
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
41
+ requirement: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - "~>"
44
+ - !ruby/object:Gem::Version
45
+ version: '2'
32
46
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: bson_ext
36
47
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2'
53
+ - !ruby/object:Gem::Dependency
54
+ name: bson_ext
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1'
46
60
  type: :runtime
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: mongoid
50
61
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '1'
67
+ - !ruby/object:Gem::Dependency
68
+ name: mongoid
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '7'
60
74
  type: :runtime
61
- version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
63
- name: rmagick
64
75
  prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - "="
69
- - !ruby/object:Gem::Version
70
- hash: 59
71
- segments:
72
- - 2
73
- - 12
74
- - 2
75
- version: 2.12.2
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '7'
81
+ - !ruby/object:Gem::Dependency
82
+ name: rmagick
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '2'
88
+ - - "<"
89
+ - !ruby/object:Gem::Version
90
+ version: '5'
76
91
  type: :runtime
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: jeweler
80
92
  prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
84
95
  - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
90
- type: :development
91
- version_requirements: *id005
92
- description:
93
- email: rod@seologic.com
96
+ - !ruby/object:Gem::Version
97
+ version: '2'
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: '5'
101
+ description: Why roast this chestnut by that open fire, you ask? Cause thousands and
102
+ thousands of Internet vets are still using the one we wrote in PHP eons ago and
103
+ we don't want to be squandering any incidental Google juice, that's why.
104
+ email:
94
105
  executables: []
95
-
96
106
  extensions: []
97
-
98
- extra_rdoc_files:
99
- - LICENSE.txt
100
- - README.rdoc
101
- files:
102
- - .document
103
- - .rspec
107
+ extra_rdoc_files: []
108
+ files:
109
+ - ".document"
110
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
111
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
112
+ - ".github/ISSUE_TEMPLATE/task.md"
113
+ - ".github/PULL_REQUEST_TEMPLATE.md"
114
+ - ".github/dependabot.yml"
115
+ - ".github/workflows/test.yml"
116
+ - ".gitignore"
117
+ - ".rspec"
118
+ - ".simplecov"
119
+ - CODE_OF_CONDUCT.md
120
+ - CONTRIBUTING.md
104
121
  - Gemfile
105
122
  - LICENSE.txt
106
- - README.rdoc
123
+ - README.md
107
124
  - Rakefile
108
- - VERSION
125
+ - SECURITY.md
126
+ - certs/ivanoblomov.pem
109
127
  - config/initializers/mime_types.rb
128
+ - config/mongoid.yml
110
129
  - hit_counter.gemspec
111
130
  - lib/hit_counter.rb
112
- - public/images/digits/celtic/0.gif
113
- - public/images/digits/celtic/1.gif
114
- - public/images/digits/celtic/2.gif
115
- - public/images/digits/celtic/3.gif
116
- - public/images/digits/celtic/4.gif
117
- - public/images/digits/celtic/5.gif
118
- - public/images/digits/celtic/6.gif
119
- - public/images/digits/celtic/7.gif
120
- - public/images/digits/celtic/8.gif
121
- - public/images/digits/celtic/9.gif
122
- - public/images/digits/odometer/0.gif
123
- - public/images/digits/odometer/1.gif
124
- - public/images/digits/odometer/2.gif
125
- - public/images/digits/odometer/3.gif
126
- - public/images/digits/odometer/4.gif
127
- - public/images/digits/odometer/5.gif
128
- - public/images/digits/odometer/6.gif
129
- - public/images/digits/odometer/7.gif
130
- - public/images/digits/odometer/8.gif
131
- - public/images/digits/odometer/9.gif
132
- - public/images/digits/scout/0.gif
133
- - public/images/digits/scout/1.gif
134
- - public/images/digits/scout/2.gif
135
- - public/images/digits/scout/3.gif
136
- - public/images/digits/scout/4.gif
137
- - public/images/digits/scout/5.gif
138
- - public/images/digits/scout/6.gif
139
- - public/images/digits/scout/7.gif
140
- - public/images/digits/scout/8.gif
141
- - public/images/digits/scout/9.gif
131
+ - lib/tasks/install.rake
132
+ - lib/version.rb
133
+ - public/images/digits/celtic/0.png
134
+ - public/images/digits/celtic/1.png
135
+ - public/images/digits/celtic/2.png
136
+ - public/images/digits/celtic/3.png
137
+ - public/images/digits/celtic/4.png
138
+ - public/images/digits/celtic/5.png
139
+ - public/images/digits/celtic/6.png
140
+ - public/images/digits/celtic/7.png
141
+ - public/images/digits/celtic/8.png
142
+ - public/images/digits/celtic/9.png
143
+ - public/images/digits/odometer/0.png
144
+ - public/images/digits/odometer/1.png
145
+ - public/images/digits/odometer/2.png
146
+ - public/images/digits/odometer/3.png
147
+ - public/images/digits/odometer/4.png
148
+ - public/images/digits/odometer/5.png
149
+ - public/images/digits/odometer/6.png
150
+ - public/images/digits/odometer/7.png
151
+ - public/images/digits/odometer/8.png
152
+ - public/images/digits/odometer/9.png
153
+ - public/images/digits/scout/0.png
154
+ - public/images/digits/scout/1.png
155
+ - public/images/digits/scout/2.png
156
+ - public/images/digits/scout/3.png
157
+ - public/images/digits/scout/4.png
158
+ - public/images/digits/scout/5.png
159
+ - public/images/digits/scout/6.png
160
+ - public/images/digits/scout/7.png
161
+ - public/images/digits/scout/8.png
162
+ - public/images/digits/scout/9.png
142
163
  - spec/lib/hit_counter_spec.rb
143
164
  - spec/spec_helper.rb
144
- homepage: http://github.com/ivanoblomov/hit_counter
145
- licenses:
146
- - MIT
147
- post_install_message:
165
+ homepage: https://github.com/FoveaCentral/hit_counter
166
+ licenses: []
167
+ metadata: {}
168
+ post_install_message:
148
169
  rdoc_options: []
149
-
150
- require_paths:
170
+ require_paths:
151
171
  - lib
152
- required_ruby_version: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
172
+ required_ruby_version: !ruby/object:Gem::Requirement
173
+ requirements:
155
174
  - - ">="
156
- - !ruby/object:Gem::Version
157
- hash: 3
158
- segments:
159
- - 0
160
- version: "0"
161
- required_rubygems_version: !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
175
+ - !ruby/object:Gem::Version
176
+ version: '2.5'
177
+ required_rubygems_version: !ruby/object:Gem::Requirement
178
+ requirements:
164
179
  - - ">="
165
- - !ruby/object:Gem::Version
166
- hash: 3
167
- segments:
168
- - 0
169
- version: "0"
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
170
182
  requirements: []
171
-
172
- rubyforge_project:
173
- rubygems_version: 1.8.10
174
- signing_key:
175
- specification_version: 3
176
- summary: Ruby version of that old 90s chestnut, the web-site hit counter.
183
+ rubygems_version: 3.1.6
184
+ signing_key:
185
+ specification_version: 4
186
+ summary: Self-hosted Ruby version of that old 90s chestnut, the web-site hit counter.
177
187
  test_files: []
178
-
metadata.gz.sig ADDED
Binary file
data/README.rdoc DELETED
@@ -1,82 +0,0 @@
1
- = hit_counter
2
-
3
- Ruby version of that old 90s chestnut, the web-site hit counter.
4
-
5
- == How to Install
6
-
7
- 1. Install the gem and supporting files.
8
-
9
- +Gemfile+:
10
-
11
- gem 'hit_counter'
12
-
13
- Run:
14
-
15
- bundle
16
- rake hit_counter:install
17
-
18
- 2. Add a controller action to your app.
19
-
20
- +application_controller.rb+:
21
-
22
- def hit_counter
23
- return if params[:url].blank?
24
-
25
- # find or create a hit counter for this URL
26
- hc = HitCounter.get params[:url]
27
-
28
- # increase the tally by one
29
- hc.increment
30
-
31
- # get the image as a blog and stream it to the browser
32
- send_data hc.image(params[:style]).to_blob, :disposition => 'inline', :filename => "#{hc.hits}.png", :type => :png
33
- end
34
-
35
- +routes.rb+:
36
-
37
- get 'hit-counter' => 'application#hit_counter' # technically should be POST/PUT, but GET makes integration simpler
38
-
39
- 3. Add the hit-counter image tag to your site's HTML:
40
-
41
- <img alt="Hit Counter" border="0" src="/hit-counter?url=http://cnn.com&style=1" />
42
-
43
- == How to Customize the Hit-Counter Image
44
-
45
- === Use an Existing Style
46
-
47
- * You can use one of the three included styles by specifying a different +style+ param in the HTML:
48
-
49
- <img alt="Hit Counter" border="0" src="/hit-counter?url=cnn.com&style=1" />
50
-
51
- The included styles are:
52
-
53
- http://github.com/ivanoblomov/hit_counter/raw/master/public/images/digits/odometer/1.gif odometer
54
- http://github.com/ivanoblomov/hit_counter/raw/master/public/images/digits/scout/2.gif scout
55
- http://github.com/ivanoblomov/hit_counter/raw/master/public/images/digits/celtic/3.gif Celtic
56
-
57
- === Create Your Own Style
58
-
59
- 1. To add your own style, create a GIF for each of the digits, +0.gif+ through +9.gif+. Save the images in a folder named after your new style in +public/images/digits+.
60
-
61
- 2. In your controller, declare a new +STYLES+ constant and add the folder name to it:
62
-
63
- HitCounter::STYLES = ['odometer', 'scout', 'celtic', '(folder name)']
64
-
65
- 3. In your HTML, specify the new style with a +style+ param equal to its index in the array plus one (unlike arrays, the +style+ param's index is one-based):
66
-
67
- <img alt="Hit Counter" border="0" src="/hit-counter?url=cnn.com&style=4" />
68
-
69
- == Contributing to hit_counter
70
-
71
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
72
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
73
- * Fork the project
74
- * Start a feature/bugfix branch
75
- * Commit and push until you are happy with your contribution
76
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
77
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
78
-
79
- == Copyright
80
-
81
- Copyright (c) 2011 Roderick Monje. See LICENSE.txt for
82
- further details.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file