webs 0.1.3 → 0.1.5

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.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('webs', '0.1.3') do |p|
6
+ Echoe.new('webs', '0.1.5') do |p|
7
7
  p.description = "Reusable webs stuff."
8
8
  p.url = "https://colczak@github.com/websdev/websgem.git"
9
9
  p.author = "Chuck Olczak"
@@ -0,0 +1,36 @@
1
+ module Webs
2
+ # Loads a file named 'webs_config.yml' in the RAILS_ROOT/config directory and adds
3
+ # values as CONSTANTS to the webs module. This is nice for environment specific constants.
4
+ # additionally check the webs_config.yml which should support overriding for dev & test environments
5
+ # by adding a 'development.webs_config.yml" file.
6
+ def self.webs_config &block
7
+ config = YAML.load( ERB.new( File.read("#{Rails.root}/config/webs_config.yml") ).result )[Rails.env]
8
+
9
+ # CREATE CONSTANTS FOR EACH KEY
10
+ config.each_key { |k| self.const_set(k.to_s.upcase, config[k]) }
11
+ self.const_set('APP_PATH', "/apps/#{APP_NAME}")
12
+
13
+ yield if block
14
+
15
+ self.log_constants
16
+ end
17
+
18
+ # print out a list of constants, remove the config
19
+ def self.log_constants
20
+ Rails.logger.debug( "****** WEBS CONFIG ******" );
21
+ self.local_constants.sort.each do |lc|
22
+ begin
23
+ c = const_get(lc)
24
+ if c.is_a?( Module )
25
+ c = nil
26
+ else
27
+ c = c.inspect if c
28
+ end
29
+ rescue
30
+ c = ''
31
+ end
32
+ Rails.logger.debug " #{lc} => #{c}" if !c.nil?
33
+ end
34
+ Rails.logger.debug( "****** END WEBS CONFIG ******" );
35
+ end
36
+ end
data/lib/webs.rb CHANGED
@@ -5,7 +5,7 @@ require dir + 'helper/params'
5
5
  require dir + 'helper/tags'
6
6
 
7
7
  module Webs
8
- VERSION = "0.1.3".freeze
8
+ VERSION = "0.1.5".freeze
9
9
 
10
10
  module Permission
11
11
  ANYONE = 0
data/webs.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{webs}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Chuck Olczak"]
9
- s.date = %q{2010-07-23}
9
+ s.date = %q{2010-10-26}
10
10
  s.description = %q{Reusable webs stuff.}
11
11
  s.email = %q{chuck@webs.com}
12
- s.extra_rdoc_files = ["README.rdoc", "lib/controller/webs_controller.rb", "lib/helper/params.rb", "lib/helper/tags.rb", "lib/webs.rb"]
13
- s.files = ["README.rdoc", "Rakefile", "lib/controller/webs_controller.rb", "lib/helper/params.rb", "lib/helper/tags.rb", "lib/webs.rb", "webs.gemspec"]
12
+ s.extra_rdoc_files = ["README.rdoc", "lib/controller/webs_controller.rb", "lib/helper/params.rb", "lib/helper/tags.rb", "lib/webs.rb", "lib/controller/webs_controller.rb", "lib/config/webs_initializer.rb"]
13
+ s.files = ["README.rdoc", "Rakefile", "lib/controller/webs_controller.rb", "lib/helper/params.rb", "lib/helper/tags.rb", "lib/webs.rb", "lib/controller/webs_controller.rb", "lib/config/webs_initializer.rb", "webs.gemspec"]
14
14
  s.homepage = %q{http://github.com/websdotcom/websgem}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Webs", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chuck Olczak
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-23 00:00:00 -04:00
18
+ date: 2010-10-26 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -31,6 +31,7 @@ extra_rdoc_files:
31
31
  - lib/helper/params.rb
32
32
  - lib/helper/tags.rb
33
33
  - lib/webs.rb
34
+ - lib/config/webs_initializer.rb
34
35
  files:
35
36
  - README.rdoc
36
37
  - Rakefile
@@ -38,6 +39,7 @@ files:
38
39
  - lib/helper/params.rb
39
40
  - lib/helper/tags.rb
40
41
  - lib/webs.rb
42
+ - lib/config/webs_initializer.rb
41
43
  - webs.gemspec
42
44
  has_rdoc: true
43
45
  homepage: http://github.com/websdotcom/websgem