deveo 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d872e98514bab3dbab6108cc2b2ecbd34ffae36f
4
+ data.tar.gz: 5ae1ccd2a06c976b8c9584a7c494fcd4452925f3
5
+ SHA512:
6
+ metadata.gz: 3488bfb7bafa5ad7701dbc8f42cede3c651d155a0350a8ee88390244899eb4666d7ac04bb7de1d1855a88cc957ed12e3c5cbc6d8e1ff743cc58646c9ea2f8224
7
+ data.tar.gz: 76bf28b46c026e7f6c389920cc1cd9855f28512bb5fe75c750b7b2e9fb8be4de5454215580b7c5e486487ca87c3c7b71a64547bf3afebb28aa4e2ebbf1d3a0ff
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Deveo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # Deveo CLI
2
+
3
+ Deveo CLI enables its users to manage their Deveo Web Client applications via the command line.
4
+
5
+ ## Commands
6
+
7
+ `deveo create wiki` - Creates a new application under wiki/ in the current directory.
8
+ `deveo package wiki` - Creates a new zip archive of an existing application in the given path.
9
+
10
+ Invoke `deveo help` for more information on the available commands.
data/bin/deveo ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ CLI_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
4
+ $LOAD_PATH.unshift(File.join(CLI_ROOT, 'lib'))
5
+
6
+ require 'gli'
7
+ require 'deveo'
8
+
9
+ include GLI::App
10
+
11
+ module Deveo
12
+
13
+ program_desc 'Deveo CLI for creating and packaging Deveo Web Client applications.'
14
+
15
+ version VERSION
16
+
17
+ pre do |global_options, options, args|
18
+ $cli = CLI.new(global_options)
19
+ end
20
+
21
+ desc 'Create a new application'
22
+ command :create do |c|
23
+ c.action do |global_options, options, args|
24
+ unless name = args.first
25
+ help_now!('name is required')
26
+ end
27
+ $cli.create_app(name)
28
+ end
29
+ end
30
+
31
+ desc 'Package an application'
32
+ command :package do |c|
33
+ c.action do |global_options, options, args|
34
+ unless path = args.first
35
+ help_now!('path is required')
36
+ end
37
+ $cli.package_app(path)
38
+ end
39
+ end
40
+
41
+ exit run(ARGV)
42
+
43
+ end
data/lib/deveo/app.rb ADDED
@@ -0,0 +1,66 @@
1
+ module Deveo
2
+ class App
3
+
4
+ INITIAL_VERSION = "0.0.1"
5
+
6
+ def self.package(path)
7
+ Zip::File.open("#{File.basename(path)}.zip", Zip::File::CREATE) do |zipfile|
8
+ Dir[File.join(path, "**", "**")].each do |file|
9
+ zipfile.add(file.sub(File.join(path, ""), ""), file)
10
+ end
11
+ end
12
+ end
13
+
14
+ attr_reader :name, :path, :meta
15
+
16
+ def initialize(name)
17
+ @name = name
18
+ @path = "#{Dir.pwd}/#{name}"
19
+ @meta = Metadata.new(@path)
20
+ end
21
+
22
+ def init
23
+ copy_skeleton
24
+ write_metadata
25
+ end
26
+
27
+ private
28
+
29
+ def copy_skeleton
30
+ Skeleton.copy_to(@path)
31
+ end
32
+
33
+ def write_metadata
34
+ @meta.write(
35
+ id: @name.downcase,
36
+ name: @name,
37
+ version: INITIAL_VERSION,
38
+ plugin_key: SecureRandom.hex(16)
39
+ )
40
+ end
41
+
42
+ class Metadata
43
+
44
+ def initialize(app_path)
45
+ @app_path = app_path
46
+ end
47
+
48
+ def filename
49
+ File.join(@app_path, "app.json")
50
+ end
51
+
52
+ def read
53
+ JSON.parse(File.read(filename), symbolize_names: true)
54
+ end
55
+
56
+ def write(data = {})
57
+ data = read.merge(data)
58
+ File.open(filename, "w") do |file|
59
+ file.write(JSON.pretty_generate(data))
60
+ end
61
+ end
62
+
63
+ end
64
+
65
+ end
66
+ end
data/lib/deveo/cli.rb ADDED
@@ -0,0 +1,19 @@
1
+ module Deveo
2
+ class CLI
3
+
4
+ def initialize(options = {})
5
+ @options = options
6
+ end
7
+
8
+ def create_app(name)
9
+ app = App.new(name)
10
+ app.init
11
+ end
12
+
13
+ def package_app(path)
14
+ App.package(path)
15
+ end
16
+
17
+ end
18
+ end
19
+
@@ -0,0 +1,13 @@
1
+ module Deveo
2
+ class Skeleton
3
+
4
+ def self.path
5
+ File.join(CLI_ROOT, 'templates', 'app')
6
+ end
7
+
8
+ def self.copy_to(app_path)
9
+ FileUtils.cp_r(path, app_path)
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module Deveo
2
+ VERSION = '0.0.1'
3
+ end
data/lib/deveo.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'json'
2
+ require 'securerandom'
3
+ require 'zip'
4
+
5
+ require 'deveo/cli'
6
+ require 'deveo/app'
7
+ require 'deveo/skeleton'
8
+ require 'deveo/version'
@@ -0,0 +1,17 @@
1
+ {
2
+ "id": "",
3
+ "name": "",
4
+ "version": "",
5
+ "plugin_key": "",
6
+
7
+ "permissions": {
8
+ "read": ["users"]
9
+ },
10
+
11
+ "views": {
12
+ "overview": {
13
+ "layout": "page",
14
+ "scope": "company"
15
+ }
16
+ }
17
+ }
Binary file
@@ -0,0 +1,13 @@
1
+ {
2
+ "app": {
3
+ "menu": {
4
+ "overview": "Hello World"
5
+ }
6
+ },
7
+
8
+ "overview": {
9
+ "hello": "Hello World!",
10
+ "count": "There is __count__ user in your company.",
11
+ "count_plural": "There are __count__ users in your company."
12
+ }
13
+ }
@@ -0,0 +1,3 @@
1
+ <h2 class="first" data-i18n="overview.hello"></h1>
2
+
3
+ <p class="count"></p>
@@ -0,0 +1,5 @@
1
+ api.read('users/count').always(function (count) {
2
+ container.find('.count').text(d.translate(container, "overview.count", {
3
+ count: count.active
4
+ }));
5
+ });
@@ -0,0 +1,3 @@
1
+ .count {
2
+ color: #eee;
3
+ }
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: deveo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Deveo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: gli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Deveo CLI enables its users to easily create and package their Deveo
42
+ Web Client applications.
43
+ email: support@deveo.com
44
+ executables:
45
+ - deveo
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - lib/deveo/app.rb
50
+ - lib/deveo/cli.rb
51
+ - lib/deveo/skeleton.rb
52
+ - lib/deveo/version.rb
53
+ - lib/deveo.rb
54
+ - templates/app/app.json
55
+ - templates/app/assets/overview.png
56
+ - templates/app/translations/en.json
57
+ - templates/app/views/overview/base.html
58
+ - templates/app/views/overview/prepare.js
59
+ - templates/app/views/overview/view.scss
60
+ - bin/deveo
61
+ - LICENSE
62
+ - README.md
63
+ homepage: https://deveo.com
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.0.6
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Deveo CLI for managing Deveo Web Client applications.
87
+ test_files: []