honor 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  ## v1.0.1
2
2
 
3
+ * Fixed broken install generator
4
+
5
+ ## v1.0.1
6
+
3
7
  * Initial Release
4
8
  * Points
5
9
  * Scorecards
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Honor::VERSION
9
9
  gem.authors = ["Jeremy Ward"]
10
10
  gem.email = ["jrmy.ward@gmail.com"]
11
- gem.description = %q{Adds support for common gamification features such as points, leaderboards, and achievements.}
11
+ gem.description = %q{Adds common gamification features such as points, leaderboards, and achievements to a Rails Application.}
12
12
  gem.summary = %q{General gamification-centric reputation system for Rails Applications.}
13
13
  gem.homepage = "https://github.com/jrmyward/honor"
14
14
 
Binary file
@@ -0,0 +1,25 @@
1
+ require 'rails/generators/migration'
2
+
3
+ module Honor
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+ source_root File.expand_path('../templates', __FILE__)
8
+ desc "Generates migration for Points and Scorecard"
9
+
10
+ def self.next_migration_number(path)
11
+ unless @prev_migration_nr
12
+ @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
13
+ else
14
+ @prev_migration_nr += 1
15
+ end
16
+ @prev_migration_nr.to_s
17
+ end
18
+
19
+ def copy_migrations
20
+ migration_template 'create_points.rb', 'db/migrate/create_honor_points.rb'
21
+ migration_template 'create_scorecards.rb', 'db/migrate/create_honor_scorecards.rb'
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module Honor
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  # Generators are not automatically loaded by Rails
4
- require 'generators/install_generator'
4
+ require 'generators/honor/install/install_generator'
5
5
 
6
- describe Honor::InstallGenerator do
6
+ describe Honor::Generators::InstallGenerator do
7
7
  # Tell the generator where to put its output (what it thinks of as Rails.root)
8
8
  destination File.expand_path("../../../../../tmp", __FILE__)
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -107,8 +107,8 @@ dependencies:
107
107
  - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
- description: Adds support for common gamification features such as points, leaderboards,
111
- and achievements.
110
+ description: Adds common gamification features such as points, leaderboards, and achievements
111
+ to a Rails Application.
112
112
  email:
113
113
  - jrmy.ward@gmail.com
114
114
  executables: []
@@ -124,9 +124,9 @@ files:
124
124
  - Rakefile
125
125
  - honor.gemspec
126
126
  - honor.sqlite3
127
- - lib/generators/install_generator.rb
128
- - lib/generators/templates/active_record/create_points.rb
129
- - lib/generators/templates/active_record/create_scorecards.rb
127
+ - lib/generators/honor/install/install_generator.rb
128
+ - lib/generators/honor/install/templates/create_points.rb
129
+ - lib/generators/honor/install/templates/create_scorecards.rb
130
130
  - lib/honor.rb
131
131
  - lib/honor/model_additions.rb
132
132
  - lib/honor/point.rb
@@ -1,40 +0,0 @@
1
- require 'rails/generators'
2
- require 'rails/generators/active_record'
3
- require 'rails/generators/migration'
4
-
5
- module Honor
6
- class InstallGenerator < Rails::Generators::Base
7
- include Rails::Generators::Migration
8
-
9
- desc "Generates migration for Points and Scorecard"
10
-
11
- def self.orm
12
- Rails::Generators.options[:rails][:orm]
13
- end
14
-
15
- def self.source_root
16
- File.join(File.dirname(__FILE__), 'templates', (orm.to_s unless orm.class.eql?(String)) )
17
- end
18
-
19
- def self.orm_has_migration?
20
- [:active_record].include? orm
21
- end
22
-
23
- def self.next_migration_number(dirname)
24
- if ActiveRecord::Base.timestamped_migrations
25
- migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
26
- migration_number += 1
27
- migration_number.to_s
28
- else
29
- "%.3d" % (current_migration_number(dirname) + 1)
30
- end
31
- end
32
-
33
- def create_migration_file
34
- if self.class.orm_has_migration?
35
- migration_template 'create_points.rb', 'db/migrate/create_honor_points.rb'
36
- migration_template 'create_scorecards.rb', 'db/migrate/create_honor_scorecards.rb'
37
- end
38
- end
39
- end
40
- end