nutella_framework 0.4.11 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +3 -2
- data/VERSION +1 -1
- data/framework_components/binary-files-manager/bin_files_mngr.rb +67 -0
- data/framework_components/binary-files-manager/startup +5 -0
- data/framework_components/order.json +2 -1
- data/lib/config/runlist.rb +1 -1
- data/nutella_framework.gemspec +8 -3
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 296f21e2152a67070cc1899d903e32efdd743532
|
4
|
+
data.tar.gz: d8b399f0b70ffd1b676ad8b680c42c4723ec85c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d979a40f5d0fe6a0875bc9153158cfb7f5c586f6f909a64aac0f6597dcaed8b939660f58d45fa1fe7cda90e314967d01681cf16e0811aae1c1e5ce48b932dd2e
|
7
|
+
data.tar.gz: 48fef042ac069df2debd3e990025cd9ace9ce071f9e251a6cd4da4f9a83ef24cb92b29fba9b7166efd490ae345604443ec3d5e7489a76572b4de47c7b4e9b00b
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -38,5 +38,6 @@ If you already have an application you want to tinker with (like [RoomQuake](htt
|
|
38
38
|
If you want to create your own application, hold on tight, a tutorial is coming soon.
|
39
39
|
|
40
40
|
|
41
|
-
#
|
42
|
-
|
41
|
+
# Building (for contributors)
|
42
|
+
Clone the repo, `bundle install` to take care of the dependencies and then `rake` to run all the tests. If you want to build and install the gem just `rake install`. If you want a list of available build tasks, simply type `rake -T`.
|
43
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.12
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
require 'sinatra/cross_origin'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
require_relative '../../lib/config/runlist'
|
6
|
+
require_relative '../../lib/config/config'
|
7
|
+
require_relative '../../nutella_lib/framework_core'
|
8
|
+
|
9
|
+
|
10
|
+
# Set Sinatra to run in production mode
|
11
|
+
set :environment, :production
|
12
|
+
|
13
|
+
# Set Sinatra's port to nutella's main_interface_port
|
14
|
+
pt = Nutella.config['main_interface_port'] + 2
|
15
|
+
set :port, pt
|
16
|
+
|
17
|
+
# Enable Sinatra to process CORS requests
|
18
|
+
set :allow_origin, :any
|
19
|
+
set :allow_methods, [:get, :post, :options]
|
20
|
+
|
21
|
+
configure do
|
22
|
+
enable :cross_origin
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
# Set data folder
|
28
|
+
data_folder = "#{ENV['HOME']}/.nutella/data/binary-files-manager"
|
29
|
+
|
30
|
+
# If data folder doesn't exist, create it
|
31
|
+
unless Dir.exists? data_folder
|
32
|
+
FileUtils::mkdir_p data_folder
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
# Serve all files in the data folder
|
38
|
+
get "/:filename" do |fn|
|
39
|
+
send_file "#{data_folder}/#{fn}"
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
# Handle file upload
|
44
|
+
post "/upload" do
|
45
|
+
file_name = params[:filename]
|
46
|
+
file_path = "#{data_folder}/#{file_name}"
|
47
|
+
|
48
|
+
# If the file already exists, just reply with the file url
|
49
|
+
return {url: url(file_path)}.to_json if File.exist? file_path
|
50
|
+
|
51
|
+
# Otherwise, write the file and reply with URL
|
52
|
+
File.open(file_path, 'w') do |f|
|
53
|
+
f.write(params['file'][:tempfile].read)
|
54
|
+
end
|
55
|
+
{url: url(file_name)}.to_json
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
# Tests if a particular file exists
|
60
|
+
get "/test/:filename" do |fn|
|
61
|
+
if File.exist? "#{data_folder}/#{fn}"
|
62
|
+
{url: url("/#{fn}")}.to_json
|
63
|
+
else
|
64
|
+
{error: 404}.to_json
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
data/lib/config/runlist.rb
CHANGED
@@ -153,7 +153,7 @@ module Nutella
|
|
153
153
|
|
154
154
|
# Returns true if the app has no bots
|
155
155
|
def app_has_no_bots( app_id )
|
156
|
-
Dir.entries("#{app_path(app_id)}/bots").select{|entry| File.directory?(entry) && !(entry =='.' || entry == '..') }.empty?
|
156
|
+
Dir.entries("#{app_path(app_id)}/bots").select{|entry| File.directory?(File.join("#{app_path(app_id)}/bots",entry)) && !(entry =='.' || entry == '..') }.empty?
|
157
157
|
end
|
158
158
|
|
159
159
|
end
|
data/nutella_framework.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: nutella_framework 0.4.
|
5
|
+
# stub: nutella_framework 0.4.12 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "nutella_framework"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.12"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Alessandro Gnoli"]
|
14
|
-
s.date = "2015-04-
|
14
|
+
s.date = "2015-04-26"
|
15
15
|
s.description = "utella is a framework to create and run RoomApps"
|
16
16
|
s.email = "tebemis@gmail.com"
|
17
17
|
s.executables = ["nutella"]
|
@@ -93,6 +93,8 @@ Gem::Specification.new do |s|
|
|
93
93
|
"framework_components/beacon-cloud-interface/js/react/beacon-table.js",
|
94
94
|
"framework_components/beacon-cloud-interface/js/react/beacon.js",
|
95
95
|
"framework_components/beacon-cloud-interface/nutella.json",
|
96
|
+
"framework_components/binary-files-manager/bin_files_mngr.rb",
|
97
|
+
"framework_components/binary-files-manager/startup",
|
96
98
|
"framework_components/logging_bot/logging_bot.rb",
|
97
99
|
"framework_components/logging_bot/startup",
|
98
100
|
"framework_components/logging_bot/utils.rb",
|
@@ -158,6 +160,7 @@ Gem::Specification.new do |s|
|
|
158
160
|
s.add_runtime_dependency(%q<logging>, ["~> 1.8"])
|
159
161
|
s.add_runtime_dependency(%q<git>, ["~> 1.2"])
|
160
162
|
s.add_runtime_dependency(%q<sinatra>, ["~> 1.4"])
|
163
|
+
s.add_runtime_dependency(%q<sinatra-cross_origin>, ["~> 0.3.2"])
|
161
164
|
s.add_runtime_dependency(%q<thin>, ["~> 1.6"])
|
162
165
|
s.add_runtime_dependency(%q<nokogiri>, ["~> 1.6"])
|
163
166
|
s.add_runtime_dependency(%q<slop>, ["~> 4.0"])
|
@@ -173,6 +176,7 @@ Gem::Specification.new do |s|
|
|
173
176
|
s.add_dependency(%q<logging>, ["~> 1.8"])
|
174
177
|
s.add_dependency(%q<git>, ["~> 1.2"])
|
175
178
|
s.add_dependency(%q<sinatra>, ["~> 1.4"])
|
179
|
+
s.add_dependency(%q<sinatra-cross_origin>, ["~> 0.3.2"])
|
176
180
|
s.add_dependency(%q<thin>, ["~> 1.6"])
|
177
181
|
s.add_dependency(%q<nokogiri>, ["~> 1.6"])
|
178
182
|
s.add_dependency(%q<slop>, ["~> 4.0"])
|
@@ -189,6 +193,7 @@ Gem::Specification.new do |s|
|
|
189
193
|
s.add_dependency(%q<logging>, ["~> 1.8"])
|
190
194
|
s.add_dependency(%q<git>, ["~> 1.2"])
|
191
195
|
s.add_dependency(%q<sinatra>, ["~> 1.4"])
|
196
|
+
s.add_dependency(%q<sinatra-cross_origin>, ["~> 0.3.2"])
|
192
197
|
s.add_dependency(%q<thin>, ["~> 1.6"])
|
193
198
|
s.add_dependency(%q<nokogiri>, ["~> 1.6"])
|
194
199
|
s.add_dependency(%q<slop>, ["~> 4.0"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutella_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Gnoli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sinatra-cross_origin
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.3.2
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.3.2
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: thin
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -294,6 +308,8 @@ files:
|
|
294
308
|
- framework_components/beacon-cloud-interface/js/react/beacon-table.js
|
295
309
|
- framework_components/beacon-cloud-interface/js/react/beacon.js
|
296
310
|
- framework_components/beacon-cloud-interface/nutella.json
|
311
|
+
- framework_components/binary-files-manager/bin_files_mngr.rb
|
312
|
+
- framework_components/binary-files-manager/startup
|
297
313
|
- framework_components/logging_bot/logging_bot.rb
|
298
314
|
- framework_components/logging_bot/startup
|
299
315
|
- framework_components/logging_bot/utils.rb
|