umwelt 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3fb7c44d581e5564b846b059ac1c559845148d09a29463272b0899096f703c0
4
- data.tar.gz: 480f689563b3047198810f82a3d5e5ee1413adb274db39794f7f597ddaac0af8
3
+ metadata.gz: 1cb12afc2e151d2a83421d27ba2de2af374784fe3b73f6422cf48dbf35664856
4
+ data.tar.gz: c8c78d710f277519466ae71a67c8e1d004b39220c4c36c8bd05a7d04480e918b
5
5
  SHA512:
6
- metadata.gz: 1fac625d867d9c431d94101d1b1631fb956dcde15ca3d11c827a65a6cfa3b963b634ed016ecb7a1ebd67aa6d5cf66aa6d401cde7e1485bb48357d542b3b451d5
7
- data.tar.gz: 6dc250ef7899d6b942a493c2d8dd8c2d9c9efadbb9cd42815cf7e8cc71103937312a0023fb909d0213d747e951b0da33cadf56a163cb3316e523d825da9b27d6
6
+ metadata.gz: 11426ed1b445d39d6250e6d59485514bd050b5cf7ae82075fdad53ddcab33b6230b0100d5c07ae46c2c249caf623bf628146bd0b31d91c9862ec3f1ef004dd5f
7
+ data.tar.gz: 9e18c2039f542026854ce71c3962c251ac3027d56d6f75fe276fe2c8fa97542309f9076bb8a550a1d85c90794ed35d712654e8441fc1ae076aac560705e39f02
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umwelt (0.1.0)
4
+ umwelt (0.1.1)
5
5
  hanami-cli
6
6
  unparser
7
7
 
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Umwelt
2
2
 
3
- Umwelt is a way to express domain knowledge in figurable format.
3
+ Umwelt is a way to express domain knowledge in a figurable format.
4
4
  It includes a language( collection of abstractions ),
5
5
  [umwelt.dev](http://umwelt.dev) for collaborative domain development,
6
- and this gem, as tool for generate code structure and specs from umwelt.
6
+ and this gem, as a tool for generate code structure and specs from umwelt.
7
7
 
8
8
  The word `Umwelt` was borrowed from [Biosemiotics](https://en.wikipedia.org/wiki/Biosemiotics). In the semiotic theories of Jakob von Uexküll and Thomas A. Sebeok, umwelt (plural: umwelten; from the German Umwelt meaning "environment" or "surroundings") is the "biological foundations that lie at the very epicenter of the study of both communication and signification in the human [and non-human] animal".[1] The term is usually translated as "self-centered world".
9
9
  So, in our case umwelt is the world how it sees for our apps.
@@ -34,21 +34,26 @@ Main executable is `umwelt`
34
34
  ```shell
35
35
  umwelt help
36
36
  Commands:
37
- umwelt clone PROJECT # Clone project from remote Umwelt(umwelt.dev)
38
- umwelt convey PHASE SEMANTIC # Convey Phase in Semantic from local Umwelt
39
- umwelt pull # Pull project from remote Umwelt
37
+ umwelt clone PROJECT # Clone project from remote Umwelt
38
+ umwelt convey PHASE SEMANTIC # Convey Phase in Semantic from local Umwelt
39
+ umwelt example # Create example Umwelt
40
+ umwelt pull # Pull project from remote Umwelt
40
41
  umwelt version
41
42
  ```
42
43
 
43
- In first release only one command is implemented: convey.
44
- This is main feature of gem, generate imprints os code and write it to files. Examples of source files in human-readable json in `spec/examples` so we can test this feature by calling convey with parameters.
44
+ In first release only two command is implemented: example and convey.
45
+ To begin, call `example`, it will copy source files in `./.umwelt`
46
+ ```shell
47
+ umwelt example
48
+ ```
49
+ This is main feature of gem, generate imprints of code and write it to files. Let's do this and see result.
45
50
 
46
51
  ```shell
47
- bin/umwelt convey 7 plain --source=spec/examples --target=target
48
- cd target
52
+ umwelt convey 7 plain
53
+ ls -R umwelt
49
54
  ```
50
55
 
51
- After that you can see generated files in target directory.
56
+ After that you can see generated files.
52
57
 
53
58
  ```shell
54
59
  Buildung phase: 7 with semantic plain...
@@ -7,9 +7,7 @@ require 'pathname'
7
7
 
8
8
  module Umwelt::Abstract::File
9
9
  class Store
10
- extend Forwardable
11
10
  include Hanami::Interactor
12
- def_delegators FileUtils, :mkpath
13
11
 
14
12
  def initialize(path: '.umwelt')
15
13
  @path = path
@@ -3,6 +3,7 @@
3
3
  module Umwelt::CLI::Commands
4
4
  require_relative './commands/convey'
5
5
  require_relative './commands/clone'
6
+ require_relative './commands/example'
6
7
  require_relative './commands/pull'
7
8
  require_relative './commands/version'
8
9
 
@@ -10,6 +11,7 @@ module Umwelt::CLI::Commands
10
11
 
11
12
  register 'convey', Convey
12
13
  register 'clone', Clone
14
+ register 'example', Example
13
15
  register 'pull', Pull
14
16
  register 'version', Version
15
17
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Umwelt::CLI::Commands
4
+ class Example < Hanami::CLI::Command
5
+ desc 'Create example Umwelt'
6
+
7
+ option :target,
8
+ type: :string,
9
+ default: '.umwelt',
10
+ desc: 'provide target path (relative)'
11
+
12
+ def call(**options)
13
+ FileUtils.cp_r(
14
+ examples_dir,
15
+ target_dir(options.fetch(:target)),
16
+ verbose: true
17
+ )
18
+ end
19
+
20
+ def examples_dir
21
+ Pathname.new(__dir__) / '../../../../spec/examples/.'
22
+ end
23
+
24
+ def target_dir(target)
25
+ Pathname.pwd / target
26
+ end
27
+ end
28
+ end
@@ -77,7 +77,7 @@ module Umwelt::Command
77
77
  if restored.success?
78
78
  restored.struct
79
79
  else
80
- error! "Cannot restore history of #{phase_id}: #{restored.errors}"
80
+ error! "Cannot restore history from '#{source}': #{restored.errors}"
81
81
  end
82
82
  end
83
83
  end
@@ -3,7 +3,7 @@
3
3
  module Umwelt::Episode::File
4
4
  class Store < Umwelt::Abstract::File::Store
5
5
  def call(id, struct)
6
- mkpath full_path(id).dirname
6
+ full_path(id).dirname.mkpath
7
7
 
8
8
  full_path(id).write serialize(destruct(struct))
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Umwelt::History::File
4
4
  class Store < Umwelt::Abstract::File::Store
5
5
  def call(struct)
6
- mkpath full_path.dirname
6
+ full_path.dirname.mkpath
7
7
 
8
8
  full_path.write serialize destruct struct
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Umwelt::Project::File
4
4
  class Store < Umwelt::Abstract::File::Store
5
5
  def call(struct)
6
- mkpath full_path.dirname
6
+ full_path.dirname.mkpath
7
7
 
8
8
  full_path.write serialize destruct struct
9
9
  end
@@ -3,8 +3,6 @@
3
3
  module Umwelt::Tree
4
4
  class Imprint
5
5
  include Hanami::Interactor
6
- extend Forwardable
7
- def_delegators FileUtils, :mkpath
8
6
 
9
7
  expose :written_paths
10
8
 
@@ -27,7 +25,7 @@ module Umwelt::Tree
27
25
  def write(semantic)
28
26
  path = semantic.path(location: @location)
29
27
 
30
- mkpath path.dirname
28
+ path.dirname.mkpath
31
29
 
32
30
  count = path.write(semantic.code)
33
31
 
@@ -35,7 +33,7 @@ module Umwelt::Tree
35
33
  end
36
34
 
37
35
  def location_clean?
38
- mkpath imprint_root
36
+ imprint_root.mkpath
39
37
  imprint_root.empty?
40
38
  end
41
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Umwelt
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
@@ -0,0 +1,24 @@
1
+ {
2
+ "phase": {
3
+ "id": 1,
4
+ "parent_id": null,
5
+ "merge_id": null,
6
+ "user_id": 1,
7
+ "finished_at": "2018-12-19 22:54:23 UTC",
8
+ "name": "initial_phase",
9
+ "description": "Effulgence immemorial unnamable hideous."
10
+ },
11
+ "engaged": [
12
+ {
13
+ "id": 1,
14
+ "abstract_id": null,
15
+ "context_id": null,
16
+ "kind": "root",
17
+ "body": "example",
18
+ "note": "primary bus"
19
+ }
20
+ ],
21
+ "forgotten": [
22
+
23
+ ]
24
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "phase": {
3
+ "id": 2,
4
+ "parent_id": 1,
5
+ "merge_id": null,
6
+ "user_id": 1,
7
+ "finished_at": "2018-12-19 22:54:23 UTC",
8
+ "name": "alfa",
9
+ "description": "Fungus amorphous madness noisome foetid."
10
+ },
11
+ "engaged": [
12
+ {
13
+ "id": 2,
14
+ "abstract_id": null,
15
+ "context_id": 1,
16
+ "kind": "space",
17
+ "body": "alfa_alive",
18
+ "note": "auxiliary array"
19
+ },
20
+ {
21
+ "id": 3,
22
+ "abstract_id": null,
23
+ "context_id": 1,
24
+ "kind": "space",
25
+ "body": "alfa_beta",
26
+ "note": "virtual driver"
27
+ },
28
+ {
29
+ "id": 4,
30
+ "abstract_id": null,
31
+ "context_id": 1,
32
+ "kind": "space",
33
+ "body": "alfa_gamma",
34
+ "note": "neural pixel"
35
+ },
36
+ {
37
+ "id": 5,
38
+ "abstract_id": null,
39
+ "context_id": 1,
40
+ "kind": "space",
41
+ "body": "alfa_delta",
42
+ "note": "online port"
43
+ },
44
+ {
45
+ "id": 6,
46
+ "abstract_id": null,
47
+ "context_id": 1,
48
+ "kind": "space",
49
+ "body": "alfa_epsilon",
50
+ "note": "mobile bus"
51
+ },
52
+ {
53
+ "id": 7,
54
+ "abstract_id": null,
55
+ "context_id": 1,
56
+ "kind": "space",
57
+ "body": "alfa_zeta",
58
+ "note": "haptic array"
59
+ },
60
+ {
61
+ "id": 8,
62
+ "abstract_id": null,
63
+ "context_id": 1,
64
+ "kind": "space",
65
+ "body": "alfa_theta",
66
+ "note": "digital firewall"
67
+ }
68
+ ],
69
+ "forgotten": [
70
+
71
+ ]
72
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "phase": {
3
+ "id": 3,
4
+ "parent_id": 2,
5
+ "merge_id": null,
6
+ "user_id": 1,
7
+ "finished_at": "2018-12-19 22:54:23 UTC",
8
+ "name": "beta",
9
+ "description": "Foetid lurk abnormal swarthy immemorial madness daemoniac."
10
+ },
11
+ "engaged": [
12
+ {
13
+ "id": 9,
14
+ "abstract_id": null,
15
+ "context_id": 2,
16
+ "kind": "space",
17
+ "body": "beta_alive",
18
+ "note": "bluetooth matrix"
19
+ },
20
+ {
21
+ "id": 10,
22
+ "abstract_id": null,
23
+ "context_id": 6,
24
+ "kind": "space",
25
+ "body": "beta_epsilo",
26
+ "note": "primary system"
27
+ }
28
+ ],
29
+ "forgotten": [
30
+ 3
31
+ ]
32
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "phase": {
3
+ "id": 4,
4
+ "parent_id": 2,
5
+ "merge_id": null,
6
+ "user_id": 1,
7
+ "finished_at": "2018-12-19 22:54:23 UTC",
8
+ "name": "gamma",
9
+ "description": "Swarthy loathsome hideous unnamable."
10
+ },
11
+ "engaged": [
12
+ {
13
+ "id": 11,
14
+ "abstract_id": null,
15
+ "context_id": 2,
16
+ "kind": "space",
17
+ "body": "gamma_alive",
18
+ "note": "virtual application"
19
+ },
20
+ {
21
+ "id": 12,
22
+ "abstract_id": null,
23
+ "context_id": 5,
24
+ "kind": "space",
25
+ "body": "gamma_delta",
26
+ "note": "neural array"
27
+ },
28
+ {
29
+ "id": 13,
30
+ "abstract_id": null,
31
+ "context_id": 7,
32
+ "kind": "space",
33
+ "body": "gamma_zeta",
34
+ "note": "virtual bandwidth"
35
+ },
36
+ {
37
+ "id": 14,
38
+ "abstract_id": null,
39
+ "context_id": 8,
40
+ "kind": "space",
41
+ "body": "gamma_theta",
42
+ "note": "wireless port"
43
+ }
44
+ ],
45
+ "forgotten": [
46
+ 4
47
+ ]
48
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "phase": {
3
+ "id": 5,
4
+ "parent_id": 2,
5
+ "merge_id": 4,
6
+ "user_id": 1,
7
+ "finished_at": "2018-12-19 22:54:23 UTC",
8
+ "name": "delta",
9
+ "description": "Fungus iridescence cat ululate."
10
+ },
11
+ "engaged": [
12
+ {
13
+ "id": 15,
14
+ "abstract_id": null,
15
+ "context_id": 11,
16
+ "kind": "space",
17
+ "body": "delta_alive",
18
+ "note": "virtual capacitor"
19
+ },
20
+ {
21
+ "id": 16,
22
+ "abstract_id": null,
23
+ "context_id": 13,
24
+ "kind": "space",
25
+ "body": "delta_zeta",
26
+ "note": "wireless card"
27
+ },
28
+ {
29
+ "id": 17,
30
+ "abstract_id": null,
31
+ "context_id": 14,
32
+ "kind": "space",
33
+ "body": "delta_theta",
34
+ "note": "solid state hard drive"
35
+ }
36
+ ],
37
+ "forgotten": [
38
+ 5,
39
+ 12
40
+ ]
41
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "phase": {
3
+ "id": 7,
4
+ "parent_id": 5,
5
+ "merge_id": null,
6
+ "user_id": 1,
7
+ "finished_at": "2018-12-19 22:54:23 UTC",
8
+ "name": "zeta",
9
+ "description": "Dank foetid gambrel antediluvian indescribable."
10
+ },
11
+ "engaged": [
12
+ {
13
+ "id": 19,
14
+ "abstract_id": null,
15
+ "context_id": 11,
16
+ "kind": "space",
17
+ "body": "zeta_one",
18
+ "note": "primary circuit"
19
+ }
20
+ ],
21
+ "forgotten": [
22
+ 7,
23
+ 13,
24
+ 16
25
+ ]
26
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "project": {
3
+ "user_name": "sovetnik",
4
+ "project_name": "example",
5
+ "project_id": "1",
6
+ "description": "Durable Rubber Watch"
7
+ },
8
+ "phases": [
9
+ {
10
+ "id": 1,
11
+ "parent_id": null,
12
+ "merge_id": null,
13
+ "user_id": 1,
14
+ "finished_at": "2018-12-19 22:54:23 UTC",
15
+ "name": "initial_phase",
16
+ "description": "Effulgence immemorial unnamable hideous."
17
+ },
18
+ {
19
+ "id": 2,
20
+ "parent_id": 1,
21
+ "merge_id": null,
22
+ "user_id": 1,
23
+ "finished_at": "2018-12-19 22:54:23 UTC",
24
+ "name": "alfa",
25
+ "description": "Fungus amorphous madness noisome foetid."
26
+ },
27
+ {
28
+ "id": 3,
29
+ "parent_id": 2,
30
+ "merge_id": null,
31
+ "user_id": 1,
32
+ "finished_at": "2018-12-19 22:54:23 UTC",
33
+ "name": "beta",
34
+ "description": "Foetid lurk abnormal swarthy immemorial madness daemoniac."
35
+ },
36
+ {
37
+ "id": 4,
38
+ "parent_id": 2,
39
+ "merge_id": null,
40
+ "user_id": 1,
41
+ "finished_at": "2018-12-19 22:54:23 UTC",
42
+ "name": "gamma",
43
+ "description": "Swarthy loathsome hideous unnamable."
44
+ },
45
+ {
46
+ "id": 5,
47
+ "parent_id": 2,
48
+ "merge_id": 4,
49
+ "user_id": 1,
50
+ "finished_at": "2018-12-19 22:54:23 UTC",
51
+ "name": "delta",
52
+ "description": "Fungus iridescence cat ululate."
53
+ },
54
+ {
55
+ "id": 7,
56
+ "parent_id": 5,
57
+ "merge_id": null,
58
+ "user_id": 1,
59
+ "finished_at": "2018-12-19 22:54:23 UTC",
60
+ "name": "zeta",
61
+ "description": "Dank foetid gambrel antediluvian indescribable."
62
+ }
63
+ ]
64
+ }
data/umwelt.gemspec CHANGED
@@ -23,8 +23,7 @@ Gem::Specification.new do |spec|
23
23
  # to allow pushing to a single host or
24
24
  # delete this section to allow pushing to any host.
25
25
  if spec.respond_to?(:metadata)
26
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
27
-
26
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
28
27
  spec.metadata['homepage_uri'] = spec.homepage
29
28
  spec.metadata['source_code_uri'] = 'https://github.com/sovetnik/umwelt'
30
29
  # spec.metadata["changelog_uri"] = "TODO: CHANGELOG.md URL here."
@@ -39,8 +38,9 @@ Gem::Specification.new do |spec|
39
38
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
40
39
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec)/}) }
41
40
  end
41
+ spec.files += Dir['spec/examples/**/*']
42
42
  spec.bindir = 'bin'
43
- spec.executables = %w[console setup umwelt]
43
+ spec.executables = 'umwelt'
44
44
  spec.require_paths = ['lib']
45
45
 
46
46
  spec.add_dependency 'hanami-cli'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umwelt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Sovetnik
@@ -142,8 +142,6 @@ description: |
142
142
  email:
143
143
  - sovetnik@oblaka.biz
144
144
  executables:
145
- - console
146
- - setup
147
145
  - umwelt
148
146
  extensions: []
149
147
  extra_rdoc_files: []
@@ -173,6 +171,7 @@ files:
173
171
  - lib/umwelt/cli/commands.rb
174
172
  - lib/umwelt/cli/commands/clone.rb
175
173
  - lib/umwelt/cli/commands/convey.rb
174
+ - lib/umwelt/cli/commands/example.rb
176
175
  - lib/umwelt/cli/commands/pull.rb
177
176
  - lib/umwelt/cli/commands/version.rb
178
177
  - lib/umwelt/command.rb
@@ -219,11 +218,19 @@ files:
219
218
  - lib/umwelt/tree/imprint.rb
220
219
  - lib/umwelt/tree/trunk.rb
221
220
  - lib/umwelt/version.rb
221
+ - spec/examples/episodes/1.json
222
+ - spec/examples/episodes/2.json
223
+ - spec/examples/episodes/3.json
224
+ - spec/examples/episodes/4.json
225
+ - spec/examples/episodes/5.json
226
+ - spec/examples/episodes/7.json
227
+ - spec/examples/history.json
222
228
  - umwelt.gemspec
223
229
  homepage: http://umwelt.dev
224
230
  licenses:
225
231
  - MIT
226
232
  metadata:
233
+ allowed_push_host: https://rubygems.org
227
234
  homepage_uri: http://umwelt.dev
228
235
  source_code_uri: https://github.com/sovetnik/umwelt
229
236
  post_install_message: