lorj 0.1.0

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.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.gitreview +4 -0
  4. data/Gemfile +25 -0
  5. data/Gemfile.lock +34 -0
  6. data/LICENSE.txt +14 -0
  7. data/README.md +652 -0
  8. data/Rakefile +24 -0
  9. data/bin/cloud_test.rb +81 -0
  10. data/example/students_1/process/Students.rb +20 -0
  11. data/example/students_1/students.rb +16 -0
  12. data/example/students_2/process/Students.rb +27 -0
  13. data/example/students_2/students.rb +36 -0
  14. data/example/students_3/controller/yaml_students.rb +94 -0
  15. data/example/students_3/controller/yaml_students_controller.rb +123 -0
  16. data/example/students_3/process/students.rb +118 -0
  17. data/example/students_3/students.rb +93 -0
  18. data/example/students_4/controller/yaml_students.rb +82 -0
  19. data/example/students_4/controller/yaml_students_controller.rb +141 -0
  20. data/example/students_4/process/students.rb +112 -0
  21. data/example/students_4/students.rb +103 -0
  22. data/example/yaml_students/students.rb +78 -0
  23. data/example/yaml_students/yaml_students.rb +115 -0
  24. data/lib/concept.md +111 -0
  25. data/lib/core/core.rb +723 -0
  26. data/lib/core/definition.rb +505 -0
  27. data/lib/core/definition_internal.rb +338 -0
  28. data/lib/core/lorj-basecontroller.rb +90 -0
  29. data/lib/core/lorj-basedefinition.rb +1079 -0
  30. data/lib/core/lorj-baseprocess.rb +231 -0
  31. data/lib/core/lorj-data.rb +567 -0
  32. data/lib/core/lorj-keypath.rb +115 -0
  33. data/lib/core_process/CloudProcess.rb +334 -0
  34. data/lib/core_process/global_process.rb +406 -0
  35. data/lib/core_process/network_process.rb +603 -0
  36. data/lib/img/.directory +4 -0
  37. data/lib/img/account_data_access.png +0 -0
  38. data/lib/img/config_data_access.png +0 -0
  39. data/lib/img/forj-lib-concept.png +0 -0
  40. data/lib/lorj/version.rb +3 -0
  41. data/lib/lorj.rb +51 -0
  42. data/lib/prc-account.rb +339 -0
  43. data/lib/prc-config.rb +1023 -0
  44. data/lib/prc-logging.rb +183 -0
  45. data/lib/prc.rb +108 -0
  46. data/lib/providers/hpcloud/Hpcloud.rb +419 -0
  47. data/lib/providers/hpcloud/compute.rb +108 -0
  48. data/lib/providers/hpcloud/network.rb +117 -0
  49. data/lib/providers/hpcloud/security_groups.rb +67 -0
  50. data/lib/providers/mock/Mock.rb +141 -0
  51. data/lib/providers/openstack/Openstack.rb +47 -0
  52. data/lib/providers/templates/compute.rb +42 -0
  53. data/lib/providers/templates/core.rb +61 -0
  54. data/lib/providers/templates/network.rb +33 -0
  55. data/lorj-spec/defaults.yaml +26 -0
  56. data/lorj.gemspec +39 -0
  57. data/spec/forj-account_spec.rb +75 -0
  58. data/spec/forj-config_spec.rb +196 -0
  59. metadata +164 -0
data/lib/concept.md ADDED
@@ -0,0 +1,111 @@
1
+
2
+
3
+
4
+
5
+ lorj framework model
6
+ ====================
7
+
8
+ The framework is built over several pieces:
9
+
10
+ ![](img/forj-lib-concept.png "concept")
11
+
12
+ * Main
13
+
14
+ This is your main ruby code.
15
+
16
+ * Core framework (core object) + Lorj::Data collection
17
+
18
+ This object is the central system which implements controller/processes execution.
19
+
20
+ * Configuration object (config object)
21
+
22
+ A configuration management object to serves processes on external data and adapt behaviors.
23
+
24
+ * 1 or more processes
25
+
26
+ A process requires to define at least one `Lorj::Data` object type and data structure. This object will be mapped with data managed by the controller object.
27
+
28
+ It defines how to `create`, `get`, `query`, `update` or `delete` one `Lorj::Data` type
29
+
30
+ * 1 controller object
31
+
32
+ It defines functions to do what the requires the controller to do, like creating a server on hpcloud, or openstack, or even a container on docker.
33
+
34
+ Config object
35
+ -------------
36
+
37
+ lorj defines 2 different objects to provide configuration data management. But you can define your own config object as soon as you respect the API used by the framework.
38
+
39
+ * Lorj::Config
40
+
41
+ This class implements a key/value system which can be predefined (default values) and structured. It uses at least one application file definition, an optional user config file and a runtime config.
42
+
43
+ * Application configuration data file.
44
+
45
+ This file is written in `yaml`. It is structured as collection of key/value pair per sections.
46
+
47
+ Usually stored in your application path, a `defaults.yaml` file will describe config structure definition (section **:section:**) and application default values (section **:default:**).
48
+
49
+ See `Application config file : defaults.yaml`_ for details.
50
+
51
+ * User configuration data file.
52
+
53
+ This optional file is written in `yaml`. It is structured as collection of key/value pair per sections.
54
+
55
+ This file is used to redefine some application defaults (section :default:) or add user key/value pair.
56
+
57
+ * runtime data.
58
+
59
+ At runtime, you application can define any kind of key/value pair. There is no notion of section here. But you can redefine a default value set from the `User configuration data file` or from the `application configuration data file.`
60
+
61
+
62
+ Short summary about Config `get`, `set` and `save`
63
+
64
+ ![](img/config_data_access.png)
65
+
66
+
67
+ * Lorj::Account
68
+
69
+ This object uses Lorj::Config object to add 1 additionnal level of files to get/set data.
70
+
71
+ * Account configuration data file.
72
+
73
+ This file is written in `yaml`. It is structured as collection of key/value pair per sections.
74
+
75
+ The content of file respects data structure defined in the `defaults.yaml` application file.
76
+ Usually, the file is saved with
77
+
78
+ Short summary about Account `get`, `set` and `save`.
79
+
80
+ ![](img/account_data_access.png)
81
+
82
+ ###Application config file : defaults.yaml
83
+
84
+
85
+ This file stored in your application directories defines 2 main sections:
86
+
87
+ * `:default:`
88
+
89
+ This section contains a collection of key/values predefined for the application.
90
+ all those key/value pairs can be redefined in the user config
91
+
92
+ * `:section:`
93
+
94
+ This section is used to define config.yaml valid structure and data structure used by `Lorj::Account`
95
+
96
+ ###User config file : config.yaml
97
+
98
+
99
+ * `:default:`
100
+
101
+ This section contains a collection of key/values. It redefines application data if exists.
102
+
103
+ * `:any kind of section`
104
+
105
+ This section contains a collection of key/values. No references from application.
106
+
107
+
108
+
109
+ License:
110
+ ========
111
+ lorj is licensed under the Apache License, Version 2.0. See LICENSE for full license text.