concen 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,26 +14,15 @@ Add the following to the Gemfile of a Rails application.
14
14
 
15
15
  gem "concen", "~> 0.1"
16
16
 
17
- Add initializer file for concen configurations.
17
+ Run the rake task to setup Concen.
18
18
 
19
- Concen.setup do |config|
20
- config.application_name = "My Application Name"
21
- config.typekit_id = "qxq7sbk"
22
- end
19
+ rake concen:setup
23
20
 
24
- Generate mongoid.yml configuration.
25
-
26
- rails g mongoid:config
27
-
28
- For more configuration options checkout the [Mongoid documentation](http://mongoid.org/docs/installation/configuration.html).
29
-
30
- Symlink assets.
31
-
32
- rake concen:symlink_assets
21
+ Follow the brief guide upon completion of the rake task.
33
22
 
34
23
  ## Content Capturing System
35
24
 
36
- Any Rails application will require static contents at some point or another. Many of us will just write those content in Rails views. Quite recently I have begun to think that this is a wrong thing to do. We don't need a full blown Content Management System (CMS) to handle them. We rather need a Content Capturing System (CCS). Most of these contents might not come from you, but other people. Most often they are several people involved. A CCS does not focus in managing content. It focuses on capturing content from the content creator.
25
+ Any Rails application will require static contents at some point or another. Many of us will just write those contents in the Rails views. Quite recently I have begun to think that this is a wrong approach. We don't need a full blown Content Management System (CMS) to handle them. We rather need a Content Capturing System (CCS). Most of these contents might not come from you, but other people. Most often, there are several people involved. A CCS does not focus in managing content. It focuses on capturing content from the content creators.
37
26
 
38
27
  The CCS itself has a simple text editor and a simple file uploader. Contents these days are not only in the form of text but also images, audios and videos. CCS offers a quick and easy way to capture all of them.
39
28
 
@@ -47,7 +36,7 @@ Concen also comes with a configurable Markdown parser. [Markdown](http://daringf
47
36
 
48
37
  Concen::Page.published.desc(:publish_time).first.content_in_html
49
38
 
50
- Generating static content should not be performed for every request because it is expensive. Concen does not have a mechanism of caching. However it is very simple in Rails to cache a page. You don't have to use Rails page caching mechanism. You simple need to set the proper Cache-Control header. For example the following code will cache a page for 5 minutes in any reverse proxy and in the client browser. You can add a [Rack Cache](http://rtomayko.github.com/rack-cache/) or setup [Nginx reverse proxy cache](http://wiki.nginx.org/HttpProxyModule#proxy_cache) easily or even [Varnish](http://varnish-cache.org/) when the time comes.
39
+ Generating static content should not be performed for every request because it is expensive. Concen does not have a mechanism of caching. However it is very simple in Rails to cache a page. You don't have to use Rails page caching mechanism. You simply need to set the proper Cache-Control header. For example the following code will cache a page for 5 minutes in any reverse proxy and in the client browser. You can add a [Rack Cache](http://rtomayko.github.com/rack-cache/) or setup [Nginx reverse proxy cache](http://wiki.nginx.org/HttpProxyModule#proxy_cache) easily or even [Varnish](http://varnish-cache.org/) when the time comes.
51
40
 
52
41
  expires_in 5.minutes, :public => true
53
42
  fresh_when :etag => @article, :public => true
@@ -104,7 +93,7 @@ Or if you want the content in HTML format, simply call the following.
104
93
 
105
94
  ## Real Time Traffic Monitoring
106
95
 
107
- Insert the Visit Recorder JavaScript in your layout. It's recommended to append this code block right before the closing `</bod>` tag.
96
+ Insert the Visit Recorder JavaScript in your layout. It's recommended to append this code block right before the closing `</body>` tag.
108
97
 
109
98
  For layout in Haml, insert the following code block.
110
99
 
@@ -130,3 +119,25 @@ There is no extra setup for this free real-time performance monitoring. And ther
130
119
  ## Concen Web Interface
131
120
 
132
121
  To access Concen web interface, use "concen" subdomain for example http://concen.domain.com. When it's accessed for the first time, it will prompt to create a new master user. This user will have full control over the Concen. [Pow](http://pow.cx/) rack server is recommended because it provides access to subdomain by default.
122
+
123
+ ## Websites That Have Used Concen in Production
124
+
125
+ - [http://steverandytantra.com/](http://steverandytantra.com/)
126
+
127
+ If you have used Concen for any of your websites and would like to be listed here. Please send me a message.
128
+
129
+ ## Version History
130
+
131
+ - **0.1.4** (23 August 2011):
132
+
133
+ - Simpler setup process (only in 2 steps).
134
+ - Brief guide is available upon the completion of setup.
135
+ - Fix a bug in file path drag and drop function.
136
+
137
+ - **0.1.3** (21 August 2011): Minor bug fixes.
138
+
139
+ - **0.1.2** (19 August 2011): Minor bug fixes.
140
+
141
+ - **0.1.1** (19 August 2011): Minor bug fixes.
142
+
143
+ - **0.1** (19 August 2011): Initial release.
data/config/routes.rb CHANGED
@@ -4,7 +4,6 @@ require "rack/gridfs"
4
4
  Rails.application.routes.draw do
5
5
  match "/visits/record.gif" => "concen/visits#record", :as => "record_visit"
6
6
  match "/visits/js" => "concen/visits#visit_recorder_js", :as => "visit_recorder_js"
7
- mount Rack::GridFS::Endpoint.new(:db => Mongoid.database, :lookup => :path, :expires => 315360000), :at => "gridfs"
8
7
 
9
8
  scope :constraints => {:subdomain => "concen"}, :module => "concen", :as => "concen" do
10
9
  get "signout" => "sessions#destroy", :as => "signout"
@@ -61,4 +60,8 @@ Rails.application.routes.draw do
61
60
 
62
61
  root :to => "statuses#show"
63
62
  end
63
+
64
+ begin
65
+ mount Rack::GridFS::Endpoint.new(:db => Mongoid.database, :lookup => :path, :expires => 315360000), :at => "gridfs"
66
+ rescue; end;
64
67
  end
@@ -1,23 +1,87 @@
1
+ # encoding: utf-8
2
+
1
3
  namespace :concen do
2
4
  desc "Create initial setup for Control Center."
3
- task :setup => [:environment, :copy_assets] do
5
+ task :setup do
6
+ if ["development", "test"].include? Rails.env
7
+ Rake::Task["concen:generate_mongoid_config"].invoke
8
+ Rake::Task["concen:generate_initializer"].invoke
9
+ Rake::Task["concen:symlink_assets"].invoke
10
+ else
11
+ Rake::Task["concen:copy_assets"].invoke
12
+ end
13
+ message = "Concen setup for #{Rails.env} environment is complete."
14
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
15
+
16
+ if ["development", "test"].include? Rails.env
17
+ message = "\n"
18
+ message += "To access Concen's web interface, use concen as the subdomain.\n"
19
+ message += "Go to concen.#{Dir.pwd.split("/").last}.dev if you are using Pow (recommended).\n"
20
+ message += "Go to concen.lvh.me:3000 if you are using standard Rails server.\n\n"
21
+ message += "Once you can access the web interface, you will be prompted to create a new master user.\n"
22
+ message += "This user will have full control and can invite new users.\n\n"
23
+ message += "Visit https://github.com/steverandy/concen for more detailed documentation.\n\n"
24
+ message += "Enjoy.\n\n"
25
+ message += "— Steve Randy Tantra"
26
+ puts "#{message}\n"
27
+ end
28
+ puts "\n"
29
+ end
30
+
31
+ desc "Generate mongoid.yml config file."
32
+ task :generate_mongoid_config do
33
+ if File.exist?("config/mongoid.yml")
34
+ message = "mongoid.yml config file already exists."
35
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
36
+ else
37
+ system "rails generate mongoid:config > /dev/null 2>&1"
38
+ message = "config/mongoid.yml has been successfully generated."
39
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
40
+ message = "For more configuration options checkout the Mongoid documentation.\n"
41
+ message += "Available from http://mongoid.org/docs/installation/configuration.html"
42
+ puts "\n#{message}\n"
43
+ end
44
+ end
45
+
46
+ desc "Generate concen initializer file."
47
+ task :generate_initializer do
48
+ file_path = "config/initializers/concen.rb"
49
+ if File.exist? file_path
50
+ message = "concen.rb initializer file already exists."
51
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
52
+ else
53
+ File.open(file_path, 'w') do |f|
54
+ f.puts <<-INITIALIZER
55
+ Concen.setup do |config|
56
+ config.application_name = "My Application Name"
57
+ # config.typekit_id = "qxq7sbk"
58
+ end
59
+ INITIALIZER
60
+ end
61
+ message = "#{file_path} has been successfully generated."
62
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
63
+ end
4
64
  end
5
65
 
6
66
  desc "Copy assets for Control Center."
7
- task :copy_assets => :environment do
67
+ task :copy_assets do
8
68
  origin = File.join(Concen::Engine.root, "public")
9
69
  destination = File.join(Rails.root, "public")
10
70
  if Dir.exist?("#{destination}/concen") || File.exist?("#{destination}/concen")
11
71
  FileUtils.rm_r "#{destination}/concen"
12
72
  end
13
73
  FileUtils.cp_r "#{origin}/concen/", "#{destination}/"
74
+ message = "Assets have been copied to #{destination}."
75
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
14
76
  end
15
77
 
16
78
  desc "Symlink assets."
17
- task :symlink_assets => :environment do
79
+ task :symlink_assets do
18
80
  origin = File.join(Concen::Engine.root, "public")
19
81
  destination = File.join(Rails.root, "public")
20
82
  FileUtils.rm_r "#{destination}/concen" if File.directory?("#{destination}/concen")
21
83
  FileUtils.ln_s "#{origin}/concen/", "#{destination}/"
84
+ message = "Assets have been symlinked to #{destination}."
85
+ puts "\n\e[32m#{message}\e[0m\n" # Green.
22
86
  end
23
87
  end
@@ -1,3 +1,3 @@
1
1
  module Concen
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -32,16 +32,20 @@ $(document).ready(function() {
32
32
  });
33
33
 
34
34
  // Insert file path to text editor by drag and drop.
35
- $("#file-manager a.filename").draggable({
36
- revert: "invalid",
37
- helper: "clone"
38
- });
39
- $( "#text-editor" ).droppable({
40
- accept: ".filename",
41
- drop: function(event, ui) {
42
- window.editor.insert(ui.draggable.data("path"));
43
- }
44
- });
35
+ setupFilePathDragDrop = function() {
36
+ $("#file-manager a.filename").draggable( {
37
+ revert: "invalid",
38
+ helper: "clone"
39
+ });
40
+ $("#text-editor").droppable({
41
+ accept: ".filename",
42
+ drop: function(event, ui) {
43
+ window.editor.insert(ui.draggable.data("path"));
44
+ }
45
+ });
46
+ };
47
+
48
+ setupFilePathDragDrop();
45
49
 
46
50
  // Setup text editor (ace.js).
47
51
  setupTextEditor = function() {
@@ -86,15 +90,16 @@ $(document).ready(function() {
86
90
  minSizeLimit: 0, // min size
87
91
  debug: false,
88
92
  csrf: true,
89
- template: '<div class="qq-uploader">' +
90
- '<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>' +
91
- '<div class="qq-upload-button">Upload Files</div>' +
92
- '<ul class="qq-upload-list"></ul>' +
93
- '</div>',
93
+ template: "<div class='qq-uploader'>" +
94
+ "<div class='qq-upload-drop-area'><span>Drop files here to upload</span></div>" +
95
+ "<div class='qq-upload-button'>Upload Files</div>" +
96
+ "<ul class='qq-upload-list'></ul>" +
97
+ "</div>",
94
98
  onComplete: function(id, fileName, responseJSON){
95
99
  if (responseJSON.success) {
96
100
  $("#file-manager ul.qq-upload-list li.qq-upload-success").remove();
97
101
  $("#file-manager div.files").replaceWith(responseJSON.content);
102
+ setupFilePathDragDrop();
98
103
  };
99
104
  },
100
105
  showMessage: function(message){ alert(message); }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-21 00:00:00.000000000Z
12
+ date: 2011-08-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: compass
16
- requirement: &70305969845220 !ruby/object:Gem::Requirement
16
+ requirement: &70288294752920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.11.5
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70305969845220
24
+ version_requirements: *70288294752920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: haml
27
- requirement: &70305969844760 !ruby/object:Gem::Requirement
27
+ requirement: &70288294752460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.1.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70305969844760
35
+ version_requirements: *70288294752460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mustache
38
- requirement: &70305969844300 !ruby/object:Gem::Requirement
38
+ requirement: &70288294752000 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.99.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70305969844300
46
+ version_requirements: *70288294752000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: redcarpet
49
- requirement: &70305969843840 !ruby/object:Gem::Requirement
49
+ requirement: &70288294751540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.0.0b3
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70305969843840
57
+ version_requirements: *70288294751540
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mongoid
60
- requirement: &70305969843380 !ruby/object:Gem::Requirement
60
+ requirement: &70288294751080 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.0.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70305969843380
68
+ version_requirements: *70288294751080
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mongo-rails-instrumentation
71
- requirement: &70305969842920 !ruby/object:Gem::Requirement
71
+ requirement: &70288294750620 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.2.4
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70305969842920
79
+ version_requirements: *70288294750620
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: bson_ext
82
- requirement: &70305969842460 !ruby/object:Gem::Requirement
82
+ requirement: &70288294750160 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.3.0
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70305969842460
90
+ version_requirements: *70288294750160
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rack-gridfs
93
- requirement: &70305969842000 !ruby/object:Gem::Requirement
93
+ requirement: &70288294749700 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 0.4.1
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70305969842000
101
+ version_requirements: *70288294749700
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: chronic
104
- requirement: &70305969841540 !ruby/object:Gem::Requirement
104
+ requirement: &70288294749240 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 0.4.3
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70305969841540
112
+ version_requirements: *70288294749240
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: mime-types
115
- requirement: &70305969841080 !ruby/object:Gem::Requirement
115
+ requirement: &70288294748780 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '1.16'
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *70305969841080
123
+ version_requirements: *70288294748780
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: bcrypt-ruby
126
- requirement: &70305969840620 !ruby/object:Gem::Requirement
126
+ requirement: &70288294748320 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 2.1.4
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *70305969840620
134
+ version_requirements: *70288294748320
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: domainatrix
137
- requirement: &70305969840160 !ruby/object:Gem::Requirement
137
+ requirement: &70288294747860 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ~>
@@ -142,7 +142,7 @@ dependencies:
142
142
  version: 0.0.10
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *70305969840160
145
+ version_requirements: *70288294747860
146
146
  description: A Rails Engine to control and monitor Rails application from a web interface.
147
147
  It includes content capturing system, real-time traffic monitoring, and real-time
148
148
  performance monitoring. It’s built to be flexible and customizable.