scms 2.1.9 → 2.2.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTc2YTNmNTI2ZGViMzNmOTZlZmMxODRkMWIyOTBiY2NlZTAzYzEyMw==
4
+ Y2U2M2M3ZmZkYjFjZTkxMTU5MzliYmMxMGNkM2UyNWUzODkzMzA0Zg==
5
5
  data.tar.gz: !binary |-
6
- MDc4NWJiZjM2ZDIxZjg5MjEwM2I1YmI4NDAxMTQyYWNhYzIwODBhNA==
6
+ YmYyMDJiNDM1MDNlYWY5ZTNlOWYyODE1MGU0NjkzYmRhODVlYWU3ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjY1Mzg4ZmFiODdmY2YzMGRiZDg1OTNlYzczNjc2YTU1MDMzNTEyMDIxOGI1
10
- OGQ5MWYxNDYwOWI2YzNjOGViZTc4MTE2ZmI5MzNiNjZkYmEwZWNiYjUwZDYw
11
- ZTkxOWQ5YWU3MGExNGE5NGMzNzhmNmQ0MjM1OTNmZjgzYTY5MzI=
9
+ Njg2MTdjMTUxYzhkMmRlYTQ3ZTRmMDA0Njk2MzQxZWQ0NmIyZTM2ODZjMGU4
10
+ ZjRiN2U3ODRkMzNhZDZiOTkzZjY1YWUyMTZjYzc5MDJmMWMwMDZiYTg0NGYy
11
+ YWVlMGI3MjgxMWU1ZDIzZjAzNzc4Yzg0OWRiZTBkYzRmNmI1Y2E=
12
12
  data.tar.gz: !binary |-
13
- ZDU1NjFkOGMyNDNjMDNhOTE0YjczZGNiNjU2YjMxMmM0NDk3NDU0N2Q5NGQw
14
- ZDE3ZTExZWFkMzdkYWU3ODJlZjAxZDVjZGEyYjZlYjBjMjhlMTViNzM0MTRi
15
- OWZjYzQ3YzM0ZDgxMzFlNzNjOWU1YWQ5YjNjMDJiZjQ5N2EzMjI=
13
+ YmU0NTYxNGQ5MjE1ZDllZGI0NTNhZDE4Zjk3MWFiNDIxYTM4Y2RkMDIwYTU1
14
+ OTU2ZWI5Y2FhZjY3ZGM3MGQxNTM5YzdiODZkMmMyYmZjOGI1OTczOTkyYjhm
15
+ NTMxYmIzZjk1ZjkyODNiZTU3N2ViOTc5OTBiNjc2ZDhhYWVjYmU=
data/bin/scms CHANGED
@@ -11,6 +11,7 @@ require 'optparse'
11
11
  require 'fileutils'
12
12
  require 'Scms'
13
13
  require "scms/version"
14
+ require 'scms/scms-httpserver.rb'
14
15
 
15
16
  class String
16
17
  def to_path(end_slash=false)
@@ -108,32 +109,27 @@ Scms.build(Folders[:website], Folders[:config], options[:mode])
108
109
  Scms.copywebsite(Folders[:website], Folders[:pub]) if Folders[:pub] != nil
109
110
 
110
111
  threads = []
111
-
112
112
  if options[:server]
113
113
  threads << Thread.new {
114
- if system('scms-server')
115
- puts "Launched scms-server"
116
- else
117
- puts "Stop scms?"
118
- abort
119
- end
114
+ ScmsServer.start(8088, Folders[:website])
120
115
  }
121
116
  end
122
117
 
123
118
  if options[:action] == "watch"
124
- watcher = Thread.new {
119
+ #watcher = Thread.new {
125
120
  require 'filewatcher'
126
121
  FileWatcher.new(["_views", "_templates", "_source"], "Watching for changes in _views, _templates or _source").watch do |filename|
127
122
  puts "Updated " + filename
128
123
  Scms.build(Folders[:website], Folders[:config], options[:mode])
129
124
  end
130
- }
131
- watcher.join
125
+ #}
126
+ #watcher.join
132
127
  end
133
128
 
134
129
  mimetypefile = File.join(Folders[:root], "assets", "mime.types")
135
130
  S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile) if options[:action] == "deploy"
136
131
 
132
+ # join web server thread if it hasn't been used with watch action
137
133
  threads.each { |t|
138
- t.join
134
+ t.join
139
135
  }
@@ -11,8 +11,8 @@ require 'optparse'
11
11
  require 'fileutils'
12
12
  require 'Scms'
13
13
  require "scms/version"
14
- require 'webrick'
15
- require 'launchy'
14
+ require 'scms/scms-httpserver.rb'
15
+
16
16
 
17
17
  options = {}
18
18
  optparse = OptionParser.new do|opts|
@@ -49,23 +49,7 @@ optparse.parse!
49
49
 
50
50
  #puts "Working dir: #{Dir::pwd}"
51
51
  #puts "Doc root: #{options[:dir]}"
52
-
53
- include WEBrick
54
52
 
55
53
  port = options[:port]
56
- puts "Starting server: http://#{Socket.gethostname}:#{port}"
57
- #:BindAddress
58
- server = HTTPServer.new(:Port=>port,:DocumentRoot=>options[:dir])
59
- mime_types_file = File.expand_path('../assets/mime.types', File.dirname(__FILE__))
60
- puts mime_types_file
61
- WEBrick::HTTPUtils::load_mime_types(mime_types_file)
62
-
63
- trap("INT"){ server.shutdown }
64
-
65
- uri = "http://localhost:#{port}"
66
- Launchy.open( uri ) do |exception|
67
- puts "Attempted to open #{uri} and failed because #{exception}"
68
- end
69
-
70
- server.start
54
+ ScmsServer.start(port, options[:dir])
71
55
  exit
@@ -0,0 +1,32 @@
1
+ require 'webrick'
2
+ require 'launchy'
3
+
4
+ module ScmsServer
5
+ include WEBrick
6
+
7
+ def ScmsServer.start(port, root_document)
8
+
9
+ puts "Starting server: http://#{Socket.gethostname}:#{port}"
10
+ #:BindAddress
11
+ server = HTTPServer.new(:Port=> port, :DocumentRoot=> root_document)
12
+ mime_types_file = File.expand_path('../../assets/mime.types', File.dirname(__FILE__))
13
+ puts mime_types_file
14
+ WEBrick::HTTPUtils::load_mime_types(mime_types_file)
15
+
16
+ trap("INT"){
17
+ puts "Closed http server"
18
+ server.shutdown
19
+ exit!
20
+ }
21
+
22
+ uri = "http://localhost:#{port}"
23
+ Launchy.open( uri ) do |exception|
24
+ puts "Attempted to open #{uri} and failed because #{exception}"
25
+ end
26
+
27
+ server.start
28
+
29
+ return server
30
+ end
31
+
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "2.1.9"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courtenay Probert
@@ -161,6 +161,7 @@ files:
161
161
  - build commands.txt
162
162
  - lib/scms.rb
163
163
  - lib/scms/s3deploy.rb
164
+ - lib/scms/scms-httpserver.rb
164
165
  - lib/scms/scms-utils.rb
165
166
  - lib/scms/version.rb
166
167
  - lib/scms/yui.rb
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
186
  version: '0'
186
187
  requirements: []
187
188
  rubyforge_project:
188
- rubygems_version: 2.1.6
189
+ rubygems_version: 2.1.7
189
190
  signing_key:
190
191
  specification_version: 4
191
192
  summary: Create simple static websites, in a jiffy