smooster 0.2.1 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/smooster/cli/executable.rb +23 -4
- data/lib/smooster/deploy/setting.rb +27 -0
- data/lib/smooster/deploy/site_templates.rb +6 -2
- data/lib/smooster/templates/site_config.yml +31 -0
- data/lib/smooster/version.rb +1 -1
- data/lib/smooster.rb +1 -0
- metadata +4 -3
- data/lib/smooster/templates/configure.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8a582e5a50e55e468838c365c3a6a176bbf78fb
|
4
|
+
data.tar.gz: a86cf596c0420c27557fb1f4fd0dbfa3291a0767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24f95eda1f164a1d08a23fc13e872d39f437980704b62bb8d76c5053ef757bad0ee420959fea7f51dd697f6a8c3309a3a75481e5433f73701c4024e9bb8556f
|
7
|
+
data.tar.gz: 9e455cfd11edf957a4e0a14daa5b31affacbe0b1a7efb1fe6ba98ddb363b33b515322749c780bd06f20e3338c485ac2c85151e7858663f55b3c3a1d1f5c23bdc
|
data/README.md
CHANGED
@@ -32,18 +32,25 @@ This is a ruby gem
|
|
32
32
|
* A wizard for project for new sites - best case even creates a new site in smooster before deployment
|
33
33
|
* Detecting liquid variables in site_templates an auto activating liquid feature
|
34
34
|
* add subtemplate feature - auto detect similar parts in html and create subtemplates
|
35
|
-
* Feature that can create a page for each uploaded site_template (so that it's easier to check, if they are working) and return the links for all of them
|
36
|
-
* For each new generated test page, return a html validator link http://validator.w3.org/check?uri=www.smooster.com%2Fde%2Findex&charset=%28detect+automatically%29&doctype=Inline&group=0
|
37
35
|
* Create a new local project based on the smooster-html-boilerplate
|
38
36
|
* Create a local project based on a demo website - ready to deploy (for beginners, to see how it may work)
|
37
|
+
* site_config file for image and formating settings
|
38
|
+
* making the script windows ready
|
39
39
|
|
40
40
|
## Changelog
|
41
41
|
|
42
|
+
###0.3.6
|
43
|
+
* added smooster site config file for image size, blockformat and rss settings
|
44
|
+
|
45
|
+
###0.3.1
|
46
|
+
* added NEW smooster setup command to setup a new site
|
47
|
+
* renamed smooster setup to smooster register
|
48
|
+
|
42
49
|
###0.2.1
|
43
50
|
* Added Page create feature. smooster deploy initial will first upload medias, templates and then create a page for each uploaded template
|
44
51
|
|
45
52
|
###0.1.8
|
46
|
-
* MAJOR: Changed smooster
|
53
|
+
* MAJOR: Changed smooster api v2 for site_templates and media_assets from ids to smo_ids
|
47
54
|
|
48
55
|
###0.1.7
|
49
56
|
* Bugfix: use only short_path as reference for site_templates and media_assets (do be more compatible between different users systems)
|
@@ -12,8 +12,8 @@ module Smooster
|
|
12
12
|
puts Dir.pwd
|
13
13
|
end
|
14
14
|
|
15
|
-
desc "
|
16
|
-
def
|
15
|
+
desc "register API_KEY", "Register your smooster gem. Add your API_KEY"
|
16
|
+
def register(api_key)
|
17
17
|
|
18
18
|
unless File.directory?("#{Dir.home}/.smo")
|
19
19
|
FileUtils.mkdir_p("#{Dir.home}/.smo")
|
@@ -24,9 +24,9 @@ module Smooster
|
|
24
24
|
puts "done!"
|
25
25
|
end
|
26
26
|
|
27
|
-
desc "
|
27
|
+
desc "setup SITE_ID [API_URL, HTML_FOLDER]", "Setup a new site / project. SITE_ID is the smooster site_id given, when you create a new site in smooster."
|
28
28
|
#method_options :force => :boolean, :alias => :string
|
29
|
-
def
|
29
|
+
def setup(site_id, api_url="http://cms.smooster.com/api", html_folder="html")
|
30
30
|
|
31
31
|
unless File.directory?("#{Smooster::Application.instance.base_dir}/.smo")
|
32
32
|
FileUtils.mkdir_p("#{Smooster::Application.instance.base_dir}/.smo")
|
@@ -38,6 +38,12 @@ module Smooster
|
|
38
38
|
config_store[:html_folder] = html_folder
|
39
39
|
config_store[:site_id] = site_id
|
40
40
|
end
|
41
|
+
|
42
|
+
#if ([(print 'Create a site_config.yml file? [y]: '), gets.rstrip][1] == "y")
|
43
|
+
unless File.exists?("#{Smooster::Application.instance.base_dir}/site_config.yml")
|
44
|
+
File.open("#{Smooster::Application.instance.base_dir}/site_config.yml", "w+") { |file| file.write(File.read(File.expand_path('../../templates/site_config.yml', __FILE__))) }
|
45
|
+
end
|
46
|
+
#end
|
41
47
|
end
|
42
48
|
|
43
49
|
desc "deploy [TYPE]", "deploy your project to the smooster cloud DEFAULT=assets [assets,templates,all,initial]"
|
@@ -102,6 +108,19 @@ module Smooster
|
|
102
108
|
|
103
109
|
puts "#{type} done!"
|
104
110
|
end
|
111
|
+
|
112
|
+
desc "configure", "Configure the smooster site via your site_config.yml"
|
113
|
+
def configure()
|
114
|
+
|
115
|
+
if File.exists?("#{Smooster::Application.instance.base_dir}/site_config.yml")
|
116
|
+
Smooster::Deploy::Setting.upload()
|
117
|
+
|
118
|
+
puts "done!"
|
119
|
+
else
|
120
|
+
puts "no site_config.yml could be found in your project root folder. Please use 'smooster setup SITE_ID' to create site_config.yml".colorize(:red)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
105
124
|
end
|
106
125
|
|
107
126
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Smooster
|
2
|
+
module Deploy
|
3
|
+
class Setting
|
4
|
+
include ActiveModel::Model
|
5
|
+
include ActiveModel::Serializers::JSON
|
6
|
+
|
7
|
+
attr_accessor :images, :formatblock, :rss
|
8
|
+
|
9
|
+
def self.read_config
|
10
|
+
if File.exists?("#{Smooster::Application.instance.base_dir}/site_config.yml")
|
11
|
+
YAML.load(File.read("#{Smooster::Application.instance.base_dir}/site_config.yml"))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.upload
|
16
|
+
begin
|
17
|
+
response = RestClient.post "#{Smooster::Application.instance.api_url()}/#{Smooster::Application.instance.site_id()}/configure", {:configs => self.read_config}, {"Authorization" => 'Token token="'+ Smooster::Application.instance.api_key() +'"', "Accept" => 'application/vnd.smoosterid.v2'}
|
18
|
+
data = JSON.parse(response)
|
19
|
+
rescue => e
|
20
|
+
Smooster::Application.instance.logger.error "Error settings!: #{e} / #{e.backtrace.inspect}"
|
21
|
+
puts "The settings failed to be updated".colorize(:red)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -9,8 +9,12 @@ module Smooster
|
|
9
9
|
template = SiteTemplate.new({:body => body, :path => file, :checksum => Digest::MD5.hexdigest(body)})
|
10
10
|
template.smo_id = template.load_smo_id if template.load_smo_id.present?
|
11
11
|
source = Nokogiri::HTML(body)
|
12
|
-
|
13
|
-
|
12
|
+
if source.css('title').first
|
13
|
+
template.title = source.css('title').first.inner_html
|
14
|
+
collection << template
|
15
|
+
else
|
16
|
+
puts "The file #{file} is not a valid HTMl-Document. Also be sure to add a title-tag".colorize(:red)
|
17
|
+
end
|
14
18
|
end
|
15
19
|
collection
|
16
20
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
images:
|
2
|
+
size1:
|
3
|
+
width: 250
|
4
|
+
size2:
|
5
|
+
width: 400
|
6
|
+
size3:
|
7
|
+
width: 600
|
8
|
+
formats:
|
9
|
+
line1:
|
10
|
+
tag: p
|
11
|
+
name: Absatz
|
12
|
+
line2:
|
13
|
+
tag: h1
|
14
|
+
name: Überschrift 1
|
15
|
+
line3:
|
16
|
+
tag: h2
|
17
|
+
name: Überschrift 2
|
18
|
+
line4:
|
19
|
+
tag: h3
|
20
|
+
name: Überschrift 3
|
21
|
+
line5:
|
22
|
+
tag: h4
|
23
|
+
name: Überschrift 4
|
24
|
+
line6:
|
25
|
+
tag: span
|
26
|
+
name: grau & dicke Schrift
|
27
|
+
class: greybold
|
28
|
+
rss:
|
29
|
+
site_description: none
|
30
|
+
site_title:
|
31
|
+
|
data/lib/smooster/version.rb
CHANGED
data/lib/smooster.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smooster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Maier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -215,10 +215,11 @@ files:
|
|
215
215
|
- lib/smooster/deploy/media_assets.rb
|
216
216
|
- lib/smooster/deploy/page.rb
|
217
217
|
- lib/smooster/deploy/pages.rb
|
218
|
+
- lib/smooster/deploy/setting.rb
|
218
219
|
- lib/smooster/deploy/site_template.rb
|
219
220
|
- lib/smooster/deploy/site_templates.rb
|
220
221
|
- lib/smooster/rest-client/rest-client-purge.rb
|
221
|
-
- lib/smooster/templates/
|
222
|
+
- lib/smooster/templates/site_config.yml
|
222
223
|
- lib/smooster/version.rb
|
223
224
|
- logs/application.log
|
224
225
|
- smooster.gemspec
|