nutella_framework 0.4.12 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 296f21e2152a67070cc1899d903e32efdd743532
4
- data.tar.gz: d8b399f0b70ffd1b676ad8b680c42c4723ec85c1
3
+ metadata.gz: 690c1d9ab013743f733d0bed94daca0937123850
4
+ data.tar.gz: 55cfa3310daca7cffd7396f85a7ad0e960ce1da6
5
5
  SHA512:
6
- metadata.gz: d979a40f5d0fe6a0875bc9153158cfb7f5c586f6f909a64aac0f6597dcaed8b939660f58d45fa1fe7cda90e314967d01681cf16e0811aae1c1e5ce48b932dd2e
7
- data.tar.gz: 48fef042ac069df2debd3e990025cd9ace9ce071f9e251a6cd4da4f9a83ef24cb92b29fba9b7166efd490ae345604443ec3d5e7489a76572b4de47c7b4e9b00b
6
+ metadata.gz: 7420e6cc8006fe5d664020e01b002a35a286ffa3024f8e59e77a69eab67c9a104908762ebddac071e165d76dee1d1f1d8ec0b9420ffebd1c0976f16be373a61b
7
+ data.tar.gz: 5233ea225b8a9fe2de5664270518bc4411d980b75ef6004402c68c843dc98a9e6a55e8cd0b985f9f00f4aa1c16339c889cc74dff78e87b5788bbf590091fdec6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.12
1
+ 0.4.13
@@ -2,11 +2,11 @@
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.12 ruby lib
5
+ # stub: nutella_framework 0.4.13 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "nutella_framework"
9
- s.version = "0.4.12"
9
+ s.version = "0.4.13"
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"]
@@ -12,6 +12,8 @@ module Nutella
12
12
  # Implements basic persistence for framework-level components
13
13
  module Persist
14
14
 
15
+ # @!group Framework-level APIs
16
+
15
17
  # This method returns a MongoDB-backed store (i.e. persistence)
16
18
  # for a collection (i.e. an Array)
17
19
  # @param [String] name the name of the store
@@ -49,6 +51,62 @@ module Nutella
49
51
  FileUtils.mkdir_p dir_path
50
52
  JSONFilePersistedHash.new file_path
51
53
  end
54
+
55
+ # @!endgroup
56
+
57
+ # ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
58
+
59
+ # @!group Run-level APIs
60
+
61
+ # This method returns a MongoDB-backed store
62
+ # for a collection at the run level
63
+ # @param [String] app_id
64
+ # @param [String] run_id
65
+ # @param [String] name the name of the store
66
+ # @return [MongoPersistedCollection] a MongoDB-backed collection store
67
+ def self.get_run_mongo_collection_store( app_id, run_id, name )
68
+ MongoPersistedCollection.new Nutella.mongo_host, app_id, "#{run_id}/#{name}"
69
+ end
70
+
71
+ # This method returns a MongoDB-backed store
72
+ # for a single object at the run level
73
+ # @param [String] app_id
74
+ # @param [String] run_id
75
+ # @param [String] name the name of the store
76
+ # @return [MongoPersistedHash] a MongoDB-backed Hash store
77
+ def self.get_run_mongo_object_store( app_id, run_id, name )
78
+ MongoPersistedHash.new Nutella.mongo_host, app_id, 'run_persisted_hashes', "#{run_id}/#{name}"
79
+ end
80
+
81
+ # This method returns a JSON-file-backed store
82
+ # for a collection at the run level
83
+ # @param [String] app_id
84
+ # @param [String] run_id
85
+ # @param [String] name the name of the store
86
+ # @return [JSONFilePersistedCollection] a JSON-file-backed collection store
87
+ def self.get_run_json_collection_store( app_id, run_id, name )
88
+ dir_path = "#{ENV['HOME']}/.nutella/data/#{Nutella.component_id}/#{app_id}/#{run_id}"
89
+ file_path = "#{dir_path}/#{name}.json"
90
+ FileUtils.mkdir_p dir_path
91
+ JSONFilePersistedCollection.new file_path
92
+ end
93
+
94
+ # This method returns a JSON-file-backed store
95
+ # for a single object at the run level
96
+ # @param [String] app_id
97
+ # @param [String] run_id
98
+ # @param [String] name the name of the store
99
+ # @return [JSONFilePersistedHash] a JSON-file-backed Hash store
100
+ def self.get_run_json_object_store( app_id, run_id, name )
101
+ dir_path = "#{ENV['HOME']}/.nutella/data/#{Nutella.component_id}/#{app_id}/#{run_id}"
102
+ file_path = "#{dir_path}/#{name}.json"
103
+ FileUtils.mkdir_p dir_path
104
+ JSONFilePersistedHash.new file_path
105
+ end
106
+
107
+
108
+ # @!endgroup
109
+
52
110
  end
53
111
  end
54
112
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutella_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Gnoli