scms 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2IxN2JkZDQ2YzcxZGZkZmYzZmQxNzAzZTNlMTI2NDkwODJhODdhMA==
4
+ MzkwY2RiZDFhZmJiNzA3NjFmYzI0MWFhMTFlMGVkMDk2NDMwNGU5ZA==
5
5
  data.tar.gz: !binary |-
6
- Y2NiYWI5MzQwNWRhMGY1MWY3ZTg1ZmY3MWU4NjA1ODg5MTM2OWViZA==
6
+ NDk2YjU2ZDRhYTA5NTdkMTYzYjY3NTBmMzRiOGEyODI3N2E1N2EzZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmM1ODZlMWYxZWQ1YzE5NGY3ZWUyZDM0ZTZhMmRkOGJlNTUzYzZlODI0ZWY1
10
- YTJiMThiYjEwOTllYTViYTRmYzhjMDNiNGYyMWViNTcyMjA4NGU3ZjMyODk3
11
- YzM4NTg0ZjliOWU0ZTEzOGQ3MDNmMDZlYjExYWQyMDY0NTM0NDE=
9
+ NjRhYTU4MmEzZjFkN2ZmZGIzNTdmMDhiOTFlMDI3NTEwMjNiYTMzZjRkOWQ0
10
+ YjA0Y2UwZTIwYWQ1NTk2ZjNjN2JhOTViYTJhNjZlZjBkMjViOWVkNmRhMjM0
11
+ YzJiZDFhMTY2MjQ1MzI2OWRkOGRkYmZmYjk2NTY5NmY0YTJmNTk=
12
12
  data.tar.gz: !binary |-
13
- ZmI4MjJlNjliMjQ4NWNmNGRiZjljYjE2ZDA3NzkwNWJhZmUwM2U5MTlmODg4
14
- MzE3OTIzMWQzZjAxNjM0NWIyMmMwYjQ4YWU3ODJmMDU3MTU1YmFhMjVkODhi
15
- N2Q3ZWExNjFlMWFhZGMwNDZjZmFkMTk2MTBmM2NmMmE4NWNhYmI=
13
+ ZTg2MjViMGUwMzQ5NDVlMzlkZTYxNzJlZjAyMjQ2ZDliNzAyNTM3YmVkZDkw
14
+ ZjI2MGNkMTdmYTQyZWFhODZiYTk2ZDBmYWJiY2RkNzgyN2Q2YzczNTY3ZTUz
15
+ ZjI0ZTAyZDViOTFjYTAzNjg2NTJiMmIwMTEzZTUzN2Y2NjkzYmE=
data/README.md CHANGED
@@ -2,35 +2,20 @@ A static website CMS
2
2
  ====================
3
3
 
4
4
  If you need to build a quick html website but don't want to maintain each page independantly Static-CMS could be for you.
5
- StaticCMS is a static website builder that creates html files from an eruby template. This facilitates the management of the skin/theme from a single file.
5
+ StaticCMS is a static website builder that creates html files from an eruby template. This facilitates the management of the layout/skin/theme from a single file.
6
6
  It also has a few nifty features such as JavaScript and CSS bundeling and minimisation
7
7
  When your happy with your website StaticCMS will also deploy to AmazonS3 setting approperate caching settings.
8
8
 
9
9
  Find it useful? Then let me know: https://twitter.com/c_probert
10
10
 
11
- ### Installing
12
-
13
- gem install scms
14
-
15
- ### Creating a website
16
-
17
- scms -a create -w /path/to/folder
18
-
19
- _(if the -w flag is excluded it assumes current directory)_
20
-
21
- ### Building your website
22
-
23
- scms -a build -w /path/to/folder
24
-
25
- _(if the -a flag is excluded defult action is 'build')_
26
-
27
- ### Publishing your website
28
-
29
- scms -a deploy -w /path/to/folder
30
-
11
+ gem install scms
12
+ scms --create mynewsite
13
+ cd mynewsite
14
+ scms --serve
31
15
 
32
16
  Further Reading
33
17
  ---------------
34
18
 
35
- * Homepage: http://cprobert.github.io/Static-CMS/
19
+ * Homepage: http://cprobert.github.io/Static-CMS
20
+ * WYSIWYG editor: http://ipassexam.github.io/Air-Monkey/
36
21
  * ERB template language: http://www.stuartellis.eu/articles/erb/
data/bin/scms CHANGED
@@ -90,13 +90,18 @@ Folders = {
90
90
  :config => (options[:configdir] or ENV["SCMS_CONFIG_FOLDER"] or options[:website]),
91
91
  :assets => File.join(root_folder, "assets")
92
92
  }
93
+ # These can be used in the bootstrap.rb
93
94
  $website = Folders[:website]
95
+ $watch = options[:watch]
96
+ $cmsmode = options[:mode] == "cms"
94
97
 
95
- ScmsUtils.log "System root folder = #{Folders[:root]}"
96
- ScmsUtils.log "Website folder = #{Folders[:website]}"
97
- ScmsUtils.log "Destination dir = #{Folders[:destination]}"
98
- ScmsUtils.log "Config dir = #{Folders[:config]}"
99
- ScmsUtils.log "Mode = #{options[:mode]}"
98
+ configfile = File.join(Folders[:website], "_config.yml")
99
+
100
+ # ScmsUtils.log "System root folder = #{Folders[:root]}"
101
+ # ScmsUtils.log "Website folder = #{Folders[:website]}"
102
+ # ScmsUtils.log "Destination dir = #{Folders[:destination]}"
103
+ # ScmsUtils.log "Config dir = #{Folders[:config]}"
104
+ # ScmsUtils.log "Mode = #{options[:mode]}"
100
105
 
101
106
  raise "Invalid working directory! #{Folders[:website]}" if !File::directory?(Folders[:website])
102
107
 
@@ -124,22 +129,35 @@ end
124
129
  Scms.build(Folders[:website], Folders[:config], options[:mode])
125
130
  Scms.copywebsite(Folders[:website], Folders[:destination]) if Folders[:destination] != ''
126
131
 
127
- threads = []
128
- if options[:server]
129
- threads << Thread.new {
130
- ScmsServer.start(Folders[:website], options[:port])
131
- }
132
- end
133
-
134
132
  if options[:watch]
135
- #watcher = Thread.new {
136
- require 'filewatcher'
137
- FileWatcher.new(["_views", "_layouts", "_templates", "_source"], "Watching for changes in _views, _layouts or _source").watch do |filename|
138
- puts "Updated " + filename
139
- Scms.build(Folders[:website], Folders[:config], options[:mode])
133
+ require "Listen"
134
+
135
+ psst = []
136
+ #psst.push("_config.yml")# if File.exists?(configfile)
137
+ psst.push("_views") if File.directory? "_views"
138
+ psst.push("_layouts") if File.directory? "_layouts"
139
+ psst.push("_templates") if File.directory? "_templates"
140
+ psst.push("_source") if File.directory? "_source"
141
+ psst.push("_resources") if File.directory? "_resources"
142
+
143
+ puts "Setting up listen"
144
+ listener = Listen.to(psst, force_polling: true ) do |modified, added, removed|
145
+ puts "modified: #{modified}" if modified.length > 0
146
+ puts "added: #{added}" if added.length > 0
147
+ puts "removed: #{removed}" if removed.length > 0
148
+
149
+ Scms.build(Folders[:website], Folders[:config], options[:mode]) if modified.length > 0
140
150
  end
141
- #}
142
- #watcher.join
151
+ trap("INT"){
152
+ puts "Closing file watcher"
153
+ listener.stop
154
+ }
155
+ listener.start # not blocking
156
+ sleep unless options[:server]
157
+ end
158
+
159
+ if options[:server]
160
+ ScmsServer.start(Folders[:website], options[:port])
143
161
  end
144
162
 
145
163
  if options[:publish]
@@ -148,9 +166,4 @@ if options[:publish]
148
166
  mimetypefile = File.join(Folders[:assets], "mime.types")
149
167
  S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile)
150
168
  end
151
- end
152
-
153
- # join web server thread if it hasn't been used with watch action
154
- threads.each { |t|
155
- t.join
156
- }
169
+ end
@@ -20,7 +20,7 @@ module ScmsServer
20
20
  trap("INT"){
21
21
  puts "Closed http server"
22
22
  server.shutdown
23
- exit!
23
+ #exit!
24
24
  }
25
25
 
26
26
  uri = "http://#{hostname}:#{port}"
data/lib/scms/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
data/scms.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "maruku"
32
32
  spec.add_dependency "sass"
33
33
  spec.add_dependency "packr"
34
- spec.add_dependency "filewatcher"
34
+ spec.add_dependency "listen"
35
35
  spec.add_dependency "webrick"
36
36
  spec.add_dependency "launchy"
37
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courtenay Probert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-11 00:00:00.000000000 Z
11
+ date: 2013-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cprobert-s3sync
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: filewatcher
70
+ name: listen
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ! '>='
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.1.7
189
+ rubygems_version: 2.1.8
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Create simple static websites, in a jiffy