scms 2.1.1 → 2.1.2

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: b0f12ee53bf634617b6078d2ab7a5746edfc26af
4
- data.tar.gz: 74287cbcb52b4e34f82c8dda6290e7de0ec8c661
3
+ metadata.gz: 67aeb5520c7e409fe81f50e84e3c02bad04ff364
4
+ data.tar.gz: 4aa673d9e4eac14fa353de89c0d1738a89cf9d5f
5
5
  SHA512:
6
- metadata.gz: 13f00edeee34e23e6ce79e0dbf002e83e7a9b0bf8d74ffff286903ad1f7768c8c98702c9c02da5388661962aebe1f51dd423976bb25983ceedaf9ec19c46c4bd
7
- data.tar.gz: 765a78126f55b89fe08ae294045804e1b67c40f4d2069ab258c0711a34df7f5ea6054d3f85fd3743379d57796fd4195a9df8bcb4db78526d15be2c48da8b33ba
6
+ metadata.gz: 7242e1999abbde3814f56370c65631ac4cfd362cb137aa59e20ba6841373be4362936a6c28e75c184a786d7ee57da0be618eb4c7444a1fa3d83707960f2a6874
7
+ data.tar.gz: c85a647d2ba582bb952392d56c77a466adb5ea626aaf8852347e23883daeb368b3d17cf295711f8f558281247cf67ed4cbf613a63748ab15dade88c082275534
data/bin/scms CHANGED
@@ -10,6 +10,7 @@
10
10
  require 'optparse'
11
11
  require 'fileutils'
12
12
  require 'Scms'
13
+ require "scms/version"
13
14
 
14
15
  class String
15
16
  def to_path(end_slash=false)
@@ -46,13 +47,15 @@ optparse = OptionParser.new do|opts|
46
47
  options[:mode] = m
47
48
  end
48
49
 
49
- options[:verbose] = false
50
- opts.on( '-v', '--verbose', 'Output more information' ) do
51
- options[:verbose] = true
50
+ options[:version] = false
51
+ opts.on( '-v', '--version', 'Output scms version' ) do
52
+ puts "Version: #{Scms::VERSION}"
53
+ exit
52
54
  end
53
55
  # This displays the help screen, all programs are
54
56
  # assumed to have this option.
55
57
  opts.on( '-h', '--help', 'Display this help screen' ) do
58
+ puts "Default action = build; default website directory = current working directory"
56
59
  puts opts
57
60
  exit
58
61
  end
@@ -88,7 +91,7 @@ monkeyhook = File.join(Folders[:website], "scripts", "air-monkey-hook.js")
88
91
  if options[:mode] == "cms"
89
92
  FileUtils.cp(File.join(Folders[:assets], "air-monkey-hook.js"), monkeyhook)
90
93
  else
91
- FileUtils.rm(monkeyhook) if File.exist?(monkeyhook)
94
+ FileUtils.rm(monkeyhook) if File.exist?(monkeyhook) && options[:action] == "deploy"
92
95
  end
93
96
 
94
97
  #ScmsUtils.log "System root folder = #{Folders[:root]}"
@@ -101,5 +104,15 @@ raise "No website in folder #{Folders[:website]}" if !File::directory?(Folders[:
101
104
  Scms.upgrade(Folders[:website])
102
105
  Scms.build(Folders[:website], Folders[:config], options[:mode])
103
106
  Scms.copywebsite(Folders[:website], Folders[:pub]) if Folders[:pub] != nil
107
+
108
+ if options[:action] == "watch"
109
+ require 'filewatcher'
110
+ puts "Setting up watcher"
111
+ FileWatcher.new(["_views"],"Watching files:").watch do |filename|
112
+ puts "Updated " + filename
113
+ Scms.build(Folders[:website], Folders[:config], options[:mode])
114
+ end
115
+ end
116
+
104
117
  mimetypefile = File.join(Folders[:root], "assets", "mime.types")
105
118
  S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile) if options[:action] == "deploy"
@@ -197,6 +197,9 @@ module Scms
197
197
 
198
198
  monkeyhook = "";
199
199
  monkeyhook = "<script src='scripts/air-monkey-hook.js'></script>" if @mode == "cms"
200
+
201
+ livereload = ""
202
+ livereload = "<script>document.write('<script src=\"http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1\"></' + 'script>')</script>" if @mode != "deploy"
200
203
 
201
204
  pagemodel = Hash.new
202
205
  pagemodel = {
@@ -212,7 +215,8 @@ module Scms
212
215
  :navigation => navigation,
213
216
  :data => pagedata,
214
217
  :rootdir => @website,
215
- :monkeyhook => monkeyhook
218
+ :monkeyhook => monkeyhook,
219
+ :livereload => livereload
216
220
  }
217
221
 
218
222
  break if pageconfig["generate"] == nil
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "maruku"
25
25
  spec.add_dependency "sass"
26
26
  spec.add_dependency "packr"
27
+ spec.add_dependency "filewatcher"
28
+ #spec.add_dependency "guard-livereload"
27
29
 
28
30
  spec.add_development_dependency "bundler", "~> 1.3"
29
31
  spec.add_development_dependency "rake"
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: 2.1.1
4
+ version: 2.1.2
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-09-13 00:00:00.000000000 Z
11
+ date: 2013-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cprobert-s3sync
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: filewatcher
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -155,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
169
  version: '0'
156
170
  requirements: []
157
171
  rubyforge_project:
158
- rubygems_version: 2.0.6
172
+ rubygems_version: 2.1.3
159
173
  signing_key:
160
174
  specification_version: 4
161
175
  summary: Create simple static websites, in a jiffy