touchstone 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +3 -0
- data/app/controllers/touchstone/application_controller.rb +6 -0
- data/app/controllers/touchstone/campaigns_controller.rb +35 -33
- data/lib/generators/touchstone/templates/touchstone.rb +7 -0
- data/lib/touchstone/configuration.rb +8 -0
- data/lib/touchstone/version.rb +1 -1
- data/lib/touchstone.rb +4 -0
- metadata +3 -3
data/README.markdown
CHANGED
@@ -32,6 +32,9 @@ This will:
|
|
32
32
|
* ~~Add a before filter to your application controller. *NB*: This defaults to setting a private method for the filter. If you already have `private` defined in your application controller, you will need to remove the duplicate declaration.~~ **Not currently working. You will need to update application\_controller.rb manually. See below.**
|
33
33
|
* Mounts the engine in your routes.rb file
|
34
34
|
|
35
|
+
## Authentication
|
36
|
+
By default, Touchstone will require http\_basic authentication to access. The credentials for access will be read from a YAML file called touchstone.yml in your config folder. You will need to create this file unless you choose not to restrict access to Touchstone (not recommended).
|
37
|
+
|
35
38
|
## Installation continued
|
36
39
|
Copy the migrations across to your application by running `rake touchstone:install:migrations`. This will add migrations to create the tables for the 3 classes set out above.
|
37
40
|
|
@@ -1,4 +1,10 @@
|
|
1
1
|
module Touchstone
|
2
2
|
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
if Touchstone.authenticate == true
|
5
|
+
config = YAML::load(File.open("#{Rails.root}/config/touchstone.yml"))
|
6
|
+
http_basic_authenticate_with :name => config['name'], :password => config['password']
|
7
|
+
end
|
8
|
+
|
3
9
|
end
|
4
10
|
end
|
@@ -1,44 +1,46 @@
|
|
1
|
-
|
1
|
+
module Touchstone
|
2
|
+
class CampaignsController < ApplicationController
|
2
3
|
|
3
|
-
|
4
|
+
layout 'touchstone/touchstone'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
def index
|
7
|
+
@campaigns = Campaign.all
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
def new
|
11
|
+
@campaign = Campaign.new
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
def create
|
15
|
+
@campaign = Campaign.new(params[:campaign])
|
16
|
+
if @campaign.save
|
17
|
+
flash[:notice] = "Campaign added"
|
18
|
+
redirect_to campaigns_url
|
19
|
+
else
|
20
|
+
flash[:error] = "Could not add campaign"
|
21
|
+
redirect_to new_campaign_url
|
22
|
+
end
|
21
23
|
end
|
22
|
-
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
def show
|
26
|
+
@campaign = Campaign.find(params[:id])
|
27
|
+
@columns = Touchstone.column_names
|
28
|
+
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
def edit
|
31
|
+
@campaign = Campaign.find(params[:id])
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
34
|
+
def update
|
35
|
+
@campaign = Campaign.find(params[:id])
|
36
|
+
if @campaign.update_attributes(params[:campaign]) && @campaign.save
|
37
|
+
flash[:notice] = "Campaign details updated"
|
38
|
+
redirect_to campaign_path(@campaign)
|
39
|
+
else
|
40
|
+
flash[:error] = "Could not update details at this time."
|
41
|
+
redirect_to campaign_path(@campaign)
|
42
|
+
end
|
41
43
|
end
|
42
|
-
end
|
43
44
|
|
45
|
+
end
|
44
46
|
end
|
@@ -23,4 +23,11 @@ Touchstone.config do |c|
|
|
23
23
|
|
24
24
|
c.currency = "$"
|
25
25
|
|
26
|
+
# If set to true, http_basic authentication will be in place
|
27
|
+
# before you can access Touchstone. You should create a YAML
|
28
|
+
# file in Rails.root/config called touchstone.yml containing
|
29
|
+
# a name and password
|
30
|
+
|
31
|
+
c.authenticate = true
|
32
|
+
|
26
33
|
end
|
data/lib/touchstone/version.rb
CHANGED
data/lib/touchstone.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: touchstone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -159,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
segments:
|
161
161
|
- 0
|
162
|
-
hash:
|
162
|
+
hash: 3352637730166065621
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
none: false
|
165
165
|
requirements:
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
segments:
|
170
170
|
- 0
|
171
|
-
hash:
|
171
|
+
hash: 3352637730166065621
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
174
|
rubygems_version: 1.8.20
|