coherent 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.7
1
+ 0.6.8
data/bin/coherent CHANGED
@@ -9,9 +9,10 @@ def find_project_file(dir=nil)
9
9
  dir ||= Dir.pwd
10
10
 
11
11
  while dir.length > 1
12
- Dir.glob(File.join(dir, '*.jsproj')) { |file|
13
- return file if File.basename(dir)===File.basename(file, '.jsproj')
14
- }
12
+ files= Dir.glob(File.join(dir, '*.jsproj'))
13
+ if (1==files.length)
14
+ return files.first
15
+ end
15
16
  dir = File.dirname(dir)
16
17
  end
17
18
 
data/coherent.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{coherent}
8
- s.version = "0.6.7"
8
+ s.version = "0.6.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Watkins"]
12
- s.date = %q{2010-11-10}
12
+ s.date = %q{2010-11-24}
13
13
  s.default_executable = %q{coherent}
14
14
  s.description = %q{Tools for building Coherent application or modules.}
15
15
  s.email = %q{jeff@metrocat.org}
@@ -58,13 +58,9 @@ Gem::Specification.new do |s|
58
58
  "generators/nib/USAGE",
59
59
  "generators/nib/nib_generator.rb",
60
60
  "generators/nib/templates/@name@.css.erb",
61
+ "generators/nib/templates/@name@.html.erb",
61
62
  "generators/nib/templates/@name@.js.erb",
62
- "generators/nib/templates/custom-view.html.erb",
63
63
  "lib/coherent.rb",
64
- "lib/distilery.rb",
65
- "lib/distilery/bundle-task.rb",
66
- "lib/distilery/coherent-asset-filter.rb",
67
- "lib/distilery/nib-file.rb",
68
64
  "lib/plugin.rb",
69
65
  "lib/plugin/commands.rb",
70
66
  "lib/plugin/commands/discover.rb",
@@ -2,16 +2,16 @@
2
2
 
3
3
  NIB('<%=name%>', {
4
4
 
5
- 'custom-view': VIEW({
6
- /* Put your view structure here. */
7
-
8
- ':root': coherent.View({
9
- /* This is the container DOM element. */
10
- })
11
- }),
5
+ '<%=name%>': VIEW({
6
+ /* Put your view structure here. */
7
+
8
+ ':root': coherent.View({
9
+ /* This is the container DOM element. */
10
+ })
11
+ }),
12
12
 
13
- 'owner': {
14
- view: 'custom-view'
15
- }
13
+ 'owner': {
14
+ view: REF('<%=name%>')
15
+ }
16
16
 
17
17
  });
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coherent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 7
10
- version: 0.6.7
9
+ - 8
10
+ version: 0.6.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Watkins
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-10 00:00:00 -08:00
18
+ date: 2010-11-24 00:00:00 -08:00
19
19
  default_executable: coherent
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -99,13 +99,9 @@ files:
99
99
  - generators/nib/USAGE
100
100
  - generators/nib/nib_generator.rb
101
101
  - generators/nib/templates/@name@.css.erb
102
+ - generators/nib/templates/@name@.html.erb
102
103
  - generators/nib/templates/@name@.js.erb
103
- - generators/nib/templates/custom-view.html.erb
104
104
  - lib/coherent.rb
105
- - lib/distilery.rb
106
- - lib/distilery/bundle-task.rb
107
- - lib/distilery/coherent-asset-filter.rb
108
- - lib/distilery/nib-file.rb
109
105
  - lib/plugin.rb
110
106
  - lib/plugin/commands.rb
111
107
  - lib/plugin/commands/discover.rb
data/lib/distilery.rb DELETED
@@ -1,5 +0,0 @@
1
- script_dir=File.join(File.dirname(__FILE__), "distilery")
2
-
3
- require "#{script_dir}/nib-file.rb"
4
- require "#{script_dir}/bundle-task.rb"
5
- require "#{script_dir}/coherent-asset-filter.rb"
@@ -1,37 +0,0 @@
1
- require "#{$script_dir}/tasks/javascript-task.rb"
2
-
3
- class BundleTask < JavascriptTask
4
-
5
- content_type "js"
6
- output_type "jsbundle"
7
-
8
- # NibTask handles files that end in .jsnib
9
- def handles_file?(file)
10
- ['js', 'css'].include?(file.content_type)
11
- end
12
-
13
- def process_file(file)
14
- destination= File.expand_path(remove_prefix||"")
15
- jsfile= JavascriptFile.new(@name_concat)
16
-
17
- if (!@concat.empty?)
18
- @concat << @concatenation_join_string||""
19
- end
20
-
21
- case file.content_type
22
- when "js"
23
- @concat << file.filtered_content(options)
24
- @debug << file.debug_content(options)
25
- when "css"
26
- included_content= file.filtered_content(options)
27
- included_content= file.minify_content(included_content)
28
-
29
- included_content= jsfile.escape_embeded_content(included_content)
30
-
31
- @concat << "NIB.asset('#{file.relative_to_folder(destination)}', '#{included_content}');\n"
32
- else
33
- file.warning "Unknown file type: #{file.content_type}"
34
- end
35
- end
36
-
37
- end
@@ -1,65 +0,0 @@
1
- require "#{$script_dir}/filters/file-reference-filter"
2
-
3
- $include_regex= /NIB\.asset\(['"]([^)]+)['"]\)/
4
- $include_regex_old= /INC\(['"]([^)]+)['"]\)/
5
-
6
- class CoherentAssetFilter < FileReferenceFilter
7
-
8
- def handles_file(file)
9
- return ["js"].include?(file.content_type)
10
- end
11
-
12
- def preprocess_content(file, content)
13
- content= content.split("\n")
14
-
15
- line_num=0
16
-
17
- content.each { |line|
18
-
19
- line_num+=1
20
-
21
- line.gsub!($include_regex) { |match|
22
-
23
- import_file= File.expand_path(File.join(file.parent_folder, $1))
24
-
25
- if (!File.exists?(import_file))
26
- file.warning "Missing asset: #{$1}", line_num
27
- "NIB.asset('#{$1}')"
28
- else
29
- asset= SourceFile.from_path(import_file)
30
- file.add_asset(asset);
31
- if (file.can_embed_as_content(asset))
32
- "NIB.asset('#{file_reference(asset)}','#{content_reference(asset)}')"
33
- else
34
- "NIB.asset('#{file_reference(asset)}')"
35
- end
36
- end
37
-
38
- }
39
-
40
- line.gsub!($include_regex_old) { |match|
41
-
42
- import_file= File.expand_path(File.join(file.parent_folder, $1))
43
-
44
- if (!File.exists?(import_file))
45
- file.warning "Missing import file: #{$1}", line_num
46
- "INC('#{$1}')"
47
- else
48
- asset= SourceFile.from_path(import_file)
49
- file.add_asset(asset);
50
- if (file.can_embed_as_content(asset))
51
- "INC('#{file_reference(asset)}','#{content_reference(asset)}')"
52
- else
53
- "INC('#{file_reference(asset)}')"
54
- end
55
- end
56
-
57
- }
58
-
59
- }
60
-
61
- content.join("\n")
62
- end
63
-
64
- end
65
-
@@ -1,13 +0,0 @@
1
- require "#{$script_dir}/file-types/javascript-file.rb"
2
-
3
- class NibFile < JavascriptFile
4
-
5
- def self.extension
6
- ".jsnib"
7
- end
8
-
9
- def content_type
10
- "js"
11
- end
12
-
13
- end