ccs_survey_gem 0.0.3 → 0.0.4

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.
@@ -31,7 +31,7 @@ class InstantDollarzCampaign < SurveyCampaign
31
31
 
32
32
  private
33
33
  def self.get_report_path
34
- '/subscription_data_generator/?username=SURVEY_CONFIG[:instantdollarz][:username]&key=SURVEY_CONFIG[:instantdollarz][:csvkey]&format=tab_bare'
34
+ "/subscription_data_generator/?username=#{SURVEY_CONFIG[:instantdollarz][:username]}&key=#{SURVEY_CONFIG[:instantdollarz][:csvkey]}&format=tab_bare"
35
35
  end
36
36
 
37
37
  def self.download_instantdollarz_campaigns
@@ -1,3 +1,3 @@
1
1
  module CcsSurveyGem
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -0,0 +1,39 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ class CcsSurveyGemGenerator < Rails::Generators::Base
5
+ include Rails::Generators::Migration
6
+
7
+ def self.source_root
8
+ @source_root ||= File.join(File.dirname(__FILE__), 'templates')
9
+ end
10
+
11
+ def self.next_migration_number(dirname)
12
+ sleep 1
13
+ if ActiveRecord::Base.timestamped_migrations
14
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
15
+ else
16
+ "%.3d" % (current_migration_number(dirname) + 1)
17
+ end
18
+ end
19
+
20
+ def create_migration_files
21
+ begin
22
+ migration_template 'create_campaign_categories.rb', 'db/migrate/create_campaign_categories.rb'
23
+ rescue
24
+ end
25
+ begin
26
+ migration_template 'create_survey_campaigns.rb', 'db/migrate/create_survey_campaigns.rb'
27
+ rescue
28
+ end
29
+ begin
30
+ migration_template 'create_survey_categories.rb', 'db/migrate/create_survey_categories.rb'
31
+ rescue
32
+ end
33
+ begin
34
+ template 'surveyconfig.yml', 'config/surveyconfig.yml'
35
+ rescue
36
+ end
37
+ end
38
+
39
+ end
@@ -0,0 +1,16 @@
1
+ class CreateCampaignCategories < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :campaign_categories do |t|
4
+ t.string :type
5
+ t.integer :instant_dollarz_category_id
6
+ t.string :name
7
+ t.boolean :visible, :default => true
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :campaign_categories
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ class CreateSurveyCampaigns < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :survey_campaigns do |t|
4
+ t.string :type
5
+ t.integer :position
6
+ t.integer :campaign_id
7
+ t.integer :campaign_category_id
8
+ t.boolean :updated, :default => false
9
+ t.boolean :current, :default => true
10
+ t.string :offer_name
11
+ t.decimal :commission, :precision => 8, :scale => 2
12
+ t.string :banner_size
13
+ t.string :offer_url
14
+ t.string :banner_url
15
+ t.text :description
16
+ t.string :reporting
17
+ t.string :category
18
+ t.string :countries
19
+ t.integer :positive_vote_count
20
+ t.integer :negative_vote_count
21
+
22
+ t.timestamps
23
+ end
24
+ end
25
+
26
+ def self.down
27
+ drop_table :survey_campaigns
28
+ end
29
+ end
@@ -0,0 +1,28 @@
1
+ class CreateSurveyCategories < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :survey_categories do |t|
4
+ t.string :type
5
+ t.integer :instant_dollarz_category_id
6
+ t.string :name
7
+ t.boolean :visible, :default => true
8
+
9
+ t.timestamps
10
+ end
11
+ rename_column :survey_campaigns, :campaign_category_id, :survey_category_id
12
+ drop_table :campaign_categories
13
+ end
14
+
15
+ def self.down
16
+ drop_table :survey_categories
17
+ create_table :campaign_categories do |t|
18
+ t.string :type
19
+ t.integer :instant_dollarz_category_id
20
+ t.string :name
21
+ t.boolean :visible, :default => true
22
+
23
+ t.timestamps
24
+ end
25
+ rename_column :survey_campaigns, :survey_category_id, :campaign_category_id
26
+
27
+ end
28
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ccs_survey_gem
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - James West
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-13 00:00:00 +00:00
18
+ date: 2011-02-13 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -41,10 +41,14 @@ files:
41
41
  - app/models/survey_category.rb
42
42
  - ccs_survey_gem.gemspec
43
43
  - config/initializers/load_survey_config.rb
44
- - config/surveyconfig.yml
45
44
  - lib/ccs_survey_gem.rb
46
45
  - lib/ccs_survey_gem/engine.rb
47
46
  - lib/ccs_survey_gem/version.rb
47
+ - lib/generators/ccs_survey_gem/ccs_survey_gem_generator.rb
48
+ - lib/generators/ccs_survey_gem/templates/create_campaign_categories.rb
49
+ - lib/generators/ccs_survey_gem/templates/create_survey_campaigns.rb
50
+ - lib/generators/ccs_survey_gem/templates/create_survey_categories.rb
51
+ - lib/generators/ccs_survey_gem/templates/surveyconfig.yml
48
52
  - nbproject/private/config.properties
49
53
  - nbproject/private/private.properties
50
54
  - nbproject/private/rake-d.txt