scms 2.1.5 → 2.1.6

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
- Mjg2MjIwNjIwYTc1MjEzZjUyMDNhMzA0ODBmZGZjOGIxMzY3M2UwYg==
4
+ MWY0MWZjZGU0MmJjYWZmZDE1ZTc3MGI3MDQ4MjRjZGMwMmVlMDhkNg==
5
5
  data.tar.gz: !binary |-
6
- ZWVkOWZkNTcyMTVkN2ZiZDQ5MmZmMWJmNzMxY2I5YzI4NTFhMDNiNw==
6
+ N2YwMDFmMzE0NDM1NDRmNjI3YjBiMTlmNTM2MWU3OTY1MjZhYTIxNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODYzMWViZDExOGUxZDJkOTMwMTgzMGRmNThlZDg2M2Q5NTU4MGNmODc0M2Ey
10
- NmIxNDY2ZDE3OTRmZTZiNzQwY2I5YTdlMDZjYTIwNjVmNWM5NTc2ZDk2Mzg4
11
- NWU0NTVlODk4YjkzNmI0YWMwODYyNDU5ZjEzMWQxMDQzOThlZjM=
9
+ NjYyMGJiNzQ0NDRmNGVjODg0MjgwYjAyNGU4ZDIwOTBlNjQwNjUwNTAxMDgw
10
+ ZmEyMjAwZjlhNWUyMjI2YzVmYTAyZTZmMWJlZDEzOWViNTdiZDg2YWEyZDg0
11
+ Yzk1MTRiZmI5YzJiNGI1NTI4ZWM1MmUwMjE2YTM0ODRmNGYyNjU=
12
12
  data.tar.gz: !binary |-
13
- ODg4ZjM5NzRmZDRiYmNkYzEwNTlmODA4YzQ5NzMyNDE1YTIwNWQwNTY4YTI0
14
- MWQyNmUyNjlmZjdlZWQ4NjY4NDZjMGUzNTk0NWUyZmEwODEyYTk5YzZkMjEw
15
- MjRjZDdlMzNiM2NmYTZiMzQ4YjZmMWE1MDFhZGFiMzg5M2ViMGM=
13
+ YmIzZTdkNzBhMWRmZDdkZTlmNTMwODRlYTA1NDdjN2Y4OTRiYjAxZTkzNjJm
14
+ MjkyMDNjZTgzMTNkNzQ2ZDdiZTFmYTA3MmU4ZWQ0NDE1MGYxNTJhNjI5NGI4
15
+ NTkzODU0ZDcwNWY0YjRhM2YxMGZjZWU4ODZkZGYzNWU0NDU4M2E=
data/bin/scms CHANGED
@@ -20,9 +20,8 @@ end
20
20
 
21
21
  options = {}
22
22
  optparse = OptionParser.new do|opts|
23
- # Set a banner, displayed at the top
24
- # of the help screen.
25
- opts.banner = "Usage: Scms [options]"
23
+ # Set a banner, displayed at the top of the help screen.
24
+ opts.banner = "Usage: scms [options]"
26
25
 
27
26
  # Define the options, and what they do
28
27
  opts.on('-w', '--website WEBSITE', "Website directory (full path)") do |w|
@@ -41,19 +40,22 @@ optparse = OptionParser.new do|opts|
41
40
  opts.on( '-a', '--action ACTION', 'build, deploy, listen or create' ) do|a|
42
41
  options[:action] = a
43
42
  end
43
+
44
+ options[:server] = false
45
+ opts.on( '-s', '--server', 'Run a scms server on port localhost:8008' ) do
46
+ options[:server] = true
47
+ end
44
48
 
45
49
  options[:mode] = "pub"
46
50
  opts.on( '-m', '--mode MODE', 'CMS or Publish' ) do|m|
47
51
  options[:mode] = m
48
52
  end
49
53
 
50
- options[:version] = false
51
54
  opts.on( '-v', '--version', 'Output scms version' ) do
52
55
  puts "Version: #{Scms::VERSION}"
53
56
  exit
54
57
  end
55
- # This displays the help screen, all programs are
56
- # assumed to have this option.
58
+ # This displays the help screen, all programs are assumed to have this option.
57
59
  opts.on( '-h', '--help', 'Display this help screen' ) do
58
60
  puts "Default action = build; default website directory = current working directory"
59
61
  puts opts
@@ -105,13 +107,23 @@ Scms.upgrade(Folders[:website])
105
107
  Scms.build(Folders[:website], Folders[:config], options[:mode])
106
108
  Scms.copywebsite(Folders[:website], Folders[:pub]) if Folders[:pub] != nil
107
109
 
108
- if options[:action] == "listen"
110
+ if options[:server]
111
+ Dir.chdir(Folders[:website]) do
112
+ Thread.new {
113
+ %x("scms-server")
114
+ }
115
+ end
116
+ end
117
+
118
+ if options[:action] == "watch"
109
119
  require 'filewatcher'
110
- FileWatcher.new(["_views", "_templates", "_source"],"Watching files:").watch do |filename|
120
+ FileWatcher.new(["_views", "_templates", "_source"], "Watching for changes in _views, _templates or _source").watch do |filename|
111
121
  puts "Updated " + filename
112
122
  Scms.build(Folders[:website], Folders[:config], options[:mode])
113
123
  end
114
124
  end
115
125
 
116
126
  mimetypefile = File.join(Folders[:root], "assets", "mime.types")
117
- S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile) if options[:action] == "deploy"
127
+ S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile) if options[:action] == "deploy"
128
+
129
+ Process.exit!(true)
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+ # This software code is made available "AS IS" without warranties of any
3
+ # kind. You may copy, display, modify and redistribute the software
4
+ # code either by itself or as incorporated into your code; provided that
5
+ # you do not remove any proprietary notices. Your use of this software
6
+ # code is at your own risk and you waive any claim against the author
7
+ # with respect to your use of this software code.
8
+ # (c) 2007 Static-CMS
9
+
10
+ require 'optparse'
11
+ require 'fileutils'
12
+ require 'Scms'
13
+ require "scms/version"
14
+ require 'webrick'
15
+ require 'launchy'
16
+
17
+ options = {}
18
+ optparse = OptionParser.new do|opts|
19
+ # Set a banner, displayed at the top of the help screen.
20
+ opts.banner = "Usage: scms-server [options]"
21
+
22
+ options[:dir] = Dir::pwd
23
+ opts.on( '-d', '--dir DIR', 'Document Root of http server [default = current working dir]' ) do|d|
24
+ options[:dir] = d
25
+ end
26
+
27
+ # options[:host] = "localhost"
28
+ # opts.on( '-h', '--host HOST', 'http host for http server [default = localhost]' ) do|h|
29
+ # options[:host] = h
30
+ # end
31
+
32
+ options[:port] = 8008
33
+ opts.on( '-p', '--port PORT', 'port for http server [default = 8008]' ) do|p|
34
+ options[:port] = p
35
+ end
36
+
37
+ options[:version] = false
38
+ opts.on( '-v', '--version', 'Output scms version' ) do
39
+ puts "Version: #{Scms::VERSION}"
40
+ exit
41
+ end
42
+ # This displays the help screen, all programs are assumed to have this option.
43
+ opts.on( '-h', '--help', 'Display this help screen' ) do
44
+ puts opts
45
+ exit
46
+ end
47
+ end
48
+ optparse.parse!
49
+
50
+ include WEBrick
51
+
52
+ port = options[:port]
53
+ puts "Starting server: http://#{Socket.gethostname}:#{port}"
54
+ #:BindAddress
55
+ server = HTTPServer.new(:Port => port, :DocumentRoot => options[:dir])
56
+ trap("INT"){ server.shutdown }
57
+
58
+ uri = "http://localhost:#{port}"
59
+ Launchy.open( uri ) do |exception|
60
+ puts "Attempted to open #{uri} and failed because #{exception}"
61
+ end
62
+
63
+ begin
64
+ server.start
65
+ ensure
66
+ server.shutdown
67
+ end
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "2.1.5"
2
+ VERSION = "2.1.6"
3
3
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "scms"
8
8
  spec.version = Scms::VERSION
9
9
 
10
- spec.required_ruby_version = '>= 1.9.3'
10
+ spec.required_ruby_version = '>= 1.9.1'
11
11
 
12
12
  spec.authors = ["Courtenay Probert"]
13
13
  spec.email = ["courtenay@probert.me.uk"]
@@ -17,6 +17,10 @@ Gem::Specification.new do |spec|
17
17
  spec.license = "MIT"
18
18
 
19
19
  spec.files = `git ls-files`.split($/)
20
+
21
+ spec.files.grep(%r{^bin/.*}) { |f|
22
+ puts "exe: #{f}"
23
+ }
20
24
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
25
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
26
  spec.require_paths = ["lib"]
@@ -28,7 +32,9 @@ Gem::Specification.new do |spec|
28
32
  spec.add_dependency "sass"
29
33
  spec.add_dependency "packr"
30
34
  spec.add_dependency "filewatcher"
35
+ spec.add_dependency "webrick"
36
+ spec.add_dependency "launchy"
31
37
 
32
- spec.add_development_dependency "bundler", "~> 1.3"
38
+ #spec.add_development_dependency "bundler", "~> 1.3"
33
39
  spec.add_development_dependency "rake"
34
40
  end
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.5
4
+ version: 2.1.6
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-08 00:00:00.000000000 Z
11
+ date: 2013-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cprobert-s3sync
@@ -81,19 +81,33 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: bundler
84
+ name: webrick
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
- version: '1.3'
90
- type: :development
89
+ version: '0'
90
+ type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
- version: '1.3'
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: launchy
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rake
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +127,7 @@ email:
113
127
  - courtenay@probert.me.uk
114
128
  executables:
115
129
  - scms
130
+ - scms-server
116
131
  extensions: []
117
132
  extra_rdoc_files: []
118
133
  files:
@@ -142,6 +157,7 @@ files:
142
157
  - assets/mime.types
143
158
  - assets/yuicompressor/readme
144
159
  - bin/scms
160
+ - bin/scms-server
145
161
  - build commands.txt
146
162
  - lib/scms.rb
147
163
  - lib/scms/s3deploy.rb
@@ -161,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
177
  requirements:
162
178
  - - ! '>='
163
179
  - !ruby/object:Gem::Version
164
- version: 1.9.3
180
+ version: 1.9.1
165
181
  required_rubygems_version: !ruby/object:Gem::Requirement
166
182
  requirements:
167
183
  - - ! '>='