hit_counter 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -0,0 +1,88 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "hit_counter"
8
+ s.version = "0.0.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Roderick Monje"]
12
+ s.date = "2011-09-17"
13
+ s.email = "rod@seologic.com"
14
+ s.extra_rdoc_files = [
15
+ "LICENSE.txt",
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ ".document",
20
+ ".rspec",
21
+ "Gemfile",
22
+ "LICENSE.txt",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "hit_counter.gemspec",
27
+ "lib/hit_counter.rb",
28
+ "public/images/digits/celtic/0.gif",
29
+ "public/images/digits/celtic/1.gif",
30
+ "public/images/digits/celtic/2.gif",
31
+ "public/images/digits/celtic/3.gif",
32
+ "public/images/digits/celtic/4.gif",
33
+ "public/images/digits/celtic/5.gif",
34
+ "public/images/digits/celtic/6.gif",
35
+ "public/images/digits/celtic/7.gif",
36
+ "public/images/digits/celtic/8.gif",
37
+ "public/images/digits/celtic/9.gif",
38
+ "public/images/digits/odometer/0.gif",
39
+ "public/images/digits/odometer/1.gif",
40
+ "public/images/digits/odometer/2.gif",
41
+ "public/images/digits/odometer/3.gif",
42
+ "public/images/digits/odometer/4.gif",
43
+ "public/images/digits/odometer/5.gif",
44
+ "public/images/digits/odometer/6.gif",
45
+ "public/images/digits/odometer/7.gif",
46
+ "public/images/digits/odometer/8.gif",
47
+ "public/images/digits/odometer/9.gif",
48
+ "public/images/digits/scout/0.gif",
49
+ "public/images/digits/scout/1.gif",
50
+ "public/images/digits/scout/2.gif",
51
+ "public/images/digits/scout/3.gif",
52
+ "public/images/digits/scout/4.gif",
53
+ "public/images/digits/scout/5.gif",
54
+ "public/images/digits/scout/6.gif",
55
+ "public/images/digits/scout/7.gif",
56
+ "public/images/digits/scout/8.gif",
57
+ "public/images/digits/scout/9.gif",
58
+ "spec/lib/hit_counter_spec.rb",
59
+ "spec/spec_helper.rb"
60
+ ]
61
+ s.homepage = "http://github.com/ivanoblomov/hit_counter"
62
+ s.licenses = ["MIT"]
63
+ s.require_paths = ["lib"]
64
+ s.rubygems_version = "1.8.10"
65
+ s.summary = "Ruby version of that old 90s chestnut, the web-site hit counter."
66
+
67
+ if s.respond_to? :specification_version then
68
+ s.specification_version = 3
69
+
70
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
71
+ s.add_runtime_dependency(%q<addressable>, [">= 0"])
72
+ s.add_runtime_dependency(%q<mongoid>, [">= 0"])
73
+ s.add_runtime_dependency(%q<rmagick>, ["= 2.12.2"])
74
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
75
+ else
76
+ s.add_dependency(%q<addressable>, [">= 0"])
77
+ s.add_dependency(%q<mongoid>, [">= 0"])
78
+ s.add_dependency(%q<rmagick>, ["= 2.12.2"])
79
+ s.add_dependency(%q<jeweler>, [">= 0"])
80
+ end
81
+ else
82
+ s.add_dependency(%q<addressable>, [">= 0"])
83
+ s.add_dependency(%q<mongoid>, [">= 0"])
84
+ s.add_dependency(%q<rmagick>, ["= 2.12.2"])
85
+ s.add_dependency(%q<jeweler>, [">= 0"])
86
+ end
87
+ end
88
+
data/lib/hit_counter.rb CHANGED
@@ -12,6 +12,10 @@
12
12
  #
13
13
  # You should have received a copy of the GNU General Public License
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+ require 'addressable/uri'
16
+ require 'mongoid'
17
+ require 'rmagick'
18
+
15
19
  class HitCounter
16
20
  include Mongoid::Document
17
21
  include Mongoid::Timestamps
@@ -102,4 +106,18 @@ class HitCounter
102
106
  def self.normalize_url value
103
107
  value !~ %r{^http://} ? "http://#{value}" : value
104
108
  end
109
+ end
110
+
111
+ if defined? Rails
112
+ class Railtie < Rails::Railtie
113
+ rake_tasks do
114
+ namespace :hit_counter do
115
+ desc 'Install HitCounter into your app.'
116
+ task :install do
117
+ puts 'Installing required image files...'
118
+ system "rsync -ruv #{Gem.searcher.find('hit_counter').full_gem_path}/public ."
119
+ end
120
+ end
121
+ end
122
+ end
105
123
  end
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,6 @@
1
1
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
- require 'addressable/uri'
4
- require 'mongoid'
5
- require 'rmagick'
6
3
  require 'rspec'
7
-
8
4
  require 'hit_counter'
9
5
 
10
6
  Mongoid::Config.from_hash 'database' => 'hit_counter'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hit_counter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roderick Monje
@@ -92,8 +92,8 @@ files:
92
92
  - README.rdoc
93
93
  - Rakefile
94
94
  - VERSION
95
+ - hit_counter.gemspec
95
96
  - lib/hit_counter.rb
96
- - lib/tasks/install.rake
97
97
  - public/images/digits/celtic/0.gif
98
98
  - public/images/digits/celtic/1.gif
99
99
  - public/images/digits/celtic/2.gif
@@ -1,7 +0,0 @@
1
- namespace :hit_counter do
2
- desc 'Install HitCounter into your app.'
3
- task :install do
4
- dir = Gem.searcher.find('hit_counter').full_gem_path
5
- system "rsync -ruv #{dir}/public/images public/images"
6
- end
7
- end