arcabouco 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e0753d9bfe23bd9d1120d77da20f267c95f98da
4
- data.tar.gz: b02a5a37152cbdb59faef2e06cee8ef102eb4352
3
+ metadata.gz: 7a93e0f420aa15cdfaab193a0e49d8243ada1d9a
4
+ data.tar.gz: 0e1af6c521d2d9391e2794cbd785c1eaa85c42be
5
5
  SHA512:
6
- metadata.gz: bd9e4fc1e07ad15d1aca216c7a352300db88a4fd7b35de2ad5f6cdb24169f1ceac36ec01ac00bfcbf22ad2b0bb464c68a9aaf367efa37d22dc71533f16580f9f
7
- data.tar.gz: d2b82260c2f7d9559575ee9c2c948543d3e05ef84beb0cb22b766feb1ff62e1ac6352a0b2eb4eaec0bbc8c5bccb391f5a7bb2cf483beb37c6f28a721e3c8103b
6
+ metadata.gz: 6a2761add2a5ee124029411b45da5e5b8de4954379b70d65d89303c13e229fee688d6c54fb76cc76c92cbe8e3441d5600d3e175ab631c66be019ce35ca59fd9c
7
+ data.tar.gz: 4dded12e42f5b99bd618215bb4f9b4cc6a32ae4059d03c745a2f7b77f49f32585793f7e4362e0d025294558e84d90226cee8a6632f947ce988d985c03f6e0a46
@@ -2,8 +2,11 @@ module Arcabouco
2
2
  class Application
3
3
  def initialize
4
4
  configure_root_directory
5
- puts "Configured root #{Arcabouco.root}"
6
- puts "Configured gem root #{Arcabouco.gem_root}"
5
+ puts "Booting Arcabouco #{Arcabouco::VERSION}"
6
+ config_filename = File.join Arcabouco.root, 'config.rb'
7
+ if File.file?(config_filename)
8
+ require config_filename
9
+ end
7
10
  end
8
11
 
9
12
  private
@@ -1,23 +1,50 @@
1
1
  module Arcabouco
2
2
 
3
- def self.root
4
- @@root
5
- end
3
+ class << self
4
+ def mattr_reader(*syms)
5
+ syms.each do |sym|
6
+ raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/
7
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
8
+ @@#{sym} = nil unless defined? @@#{sym}
9
+ def self.#{sym}
10
+ @@#{sym}
11
+ end
12
+ EOS
6
13
 
7
- def self.root=(root)
8
- @@root = root
9
- end
14
+ class_variable_set("@@#{sym}", yield) if block_given?
15
+ end
16
+ end
10
17
 
11
- def self.gem_root
12
- @@gem_root
13
- end
18
+ def mattr_writer(*syms)
19
+ syms.each do |sym|
20
+ raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/
21
+ class_eval(<<-EOS, __FILE__, __LINE__ + 1)
22
+ @@#{sym} = nil unless defined? @@#{sym}
23
+ def self.#{sym}=(obj)
24
+ @@#{sym} = obj
25
+ end
26
+ EOS
14
27
 
15
- def self.gem_root=(root)
16
- @@gem_root = root
28
+ send("#{sym}=", yield) if block_given?
29
+ end
30
+ end
31
+
32
+ def mattr_accessor(*syms, &blk)
33
+ mattr_reader(*syms, &blk)
34
+ mattr_writer(*syms, &blk)
35
+ end
17
36
  end
18
37
 
19
- def self.asset_list
20
- %w(jquery.js app.css app.js vendor.js vendor.css *.png)
38
+ mattr_accessor :root
39
+ mattr_accessor :gem_root
40
+ mattr_accessor :asset_list
41
+ mattr_accessor :application_name
42
+
43
+ self.asset_list = %w(jquery.js app.css app.js vendor.js vendor.css *.png *.jpg *.gif *.mp3 *.wav)
44
+ self.application_name = "Arcabouco Application"
45
+
46
+ def self.setup
47
+ yield self
21
48
  end
22
49
 
23
50
  end
@@ -46,7 +46,7 @@ module Arcabouco
46
46
  end
47
47
 
48
48
  def content_for_index
49
- erb :"#{relative_to}/index.html", locals: { :assets => $environment }, layout: false, cache: false
49
+ erb :"#{relative_to}/index.html", locals: { :assets => $environment, :application_name => Arcabouco.application_name}, layout: false, cache: false
50
50
  end
51
51
 
52
52
  get '/save_app.html' do
@@ -1,3 +1,3 @@
1
1
  module Arcabouco
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html class='no-js not-ready'>
3
3
  <head>
4
- <title>...</title>
4
+ <title><%= application_name %></title>
5
5
  <meta charset='utf-8'>
6
6
  <meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'>
7
7
  <meta content='yes' name='apple-mobile-web-app-capable'>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcabouco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Negri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-18 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack