reality-mda 1.4.0 → 1.5.0

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: d4f78f97e0eaef788e6dd8be60def7c86d705f5f
4
- data.tar.gz: 67caf75f9efd96fe6482b2dca33d87350a884b48
3
+ metadata.gz: bc8f6a5a3a8ba9f669cf539e149b6e3afd96a431
4
+ data.tar.gz: c5a09d846dcaca79a22e0b351c0dd4e9a043b0ab
5
5
  SHA512:
6
- metadata.gz: 5ab5e00f3d41cdc78532739a506d4af6cdd79a5e6ad42b9a40a4d0424937a47d58425864d1996bd2dc24e2858fdeb072108e2bd80dd506fa405cf0b6ce5ec896
7
- data.tar.gz: 64543fe870c3aa17eb966a56e2e441ff43486cf5079a5ba2653fb9d3bfb46db3b536d07178c2e1d5e512b0da1674a63ed1f11a3065e7143ceb0e09a42b4bc566
6
+ metadata.gz: 3f9871559b74f2a9c8bda2a8f13d6962a52ce9c6a22974a0384326d422429f80d3463d8b1c8c4cc30e296b6b6f92629b689a2fa574e479f999533d37db2cabbc
7
+ data.tar.gz: 0383c196e7d77d18cf572ed114970ec3bfb1c3e107f5be01cf6ff9270e692ac1373c532c8d705f67bc4004bcf366b74db42d24b43f7f1dca5d52a813af9310bd
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@ language: ruby
2
2
  sudo: false
3
3
  rvm:
4
4
  - 2.3.1
5
- - jruby-19mode
6
5
  jdk:
7
6
  - oraclejdk8
8
7
  git:
data/lib/reality/mda.rb CHANGED
@@ -13,6 +13,9 @@
13
13
  #
14
14
 
15
15
  require 'reality/logging'
16
+ require 'reality/facets'
17
+ require 'reality/generators'
18
+ require 'reality/model'
16
19
  require 'reality/naming'
17
20
  require 'reality/options'
18
21
  require 'reality/orderedhash'
@@ -70,6 +70,7 @@ module Reality #nodoc
70
70
 
71
71
  root_element = root_elements[0]
72
72
  define_build_container(module_type, root_element, template_set_container, options)
73
+ module_type
73
74
  end
74
75
 
75
76
  private
data/reality-mda.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{reality-mda}
5
- s.version = '1.4.0'
5
+ s.version = '1.5.0'
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['Peter Donald']
@@ -28,7 +28,6 @@ Gem::Specification.new do |s|
28
28
  s.add_dependency 'reality-model', '>= 1.1.0'
29
29
  s.add_dependency 'reality-orderedhash', '>= 1.0.0'
30
30
 
31
- s.add_development_dependency 'reality-facets', '>= 1.3.0'
32
31
  s.add_development_dependency(%q<minitest>, ['= 5.9.1'])
33
32
  s.add_development_dependency(%q<test-unit>, ['= 3.1.5'])
34
33
  end
data/test/helper.rb CHANGED
@@ -6,4 +6,34 @@ require 'reality/mda'
6
6
 
7
7
  class Reality::Mda::TestCase < Minitest::Test
8
8
  include Test::Unit::Assertions
9
+
10
+ def setup
11
+ FileUtils.mkdir_p self.working_dir
12
+
13
+ self.class.send(:remove_const, :TestModule) if self.class.const_defined?(:TestModule)
14
+ self.class.class_eval <<-RUBY
15
+ module TestModule
16
+ end
17
+ RUBY
18
+ end
19
+
20
+ def teardown
21
+ if passed?
22
+ FileUtils.rm_rf self.working_dir if File.exist?(self.working_dir)
23
+ else
24
+ $stderr.puts "Test #{self.class.name}.#{name} Failed. Leaving working directory #{self.working_dir}"
25
+ end
26
+ end
27
+
28
+ def local_dir(directory = SecureRandom.hex)
29
+ "#{working_dir}/#{directory}"
30
+ end
31
+
32
+ def working_dir
33
+ @working_dir ||= "#{workspace_dir}/#{SecureRandom.hex}"
34
+ end
35
+
36
+ def workspace_dir
37
+ @workspace_dir ||= ENV['TEST_TMP_DIR'] || File.expand_path("#{File.dirname(__FILE__)}/../tmp/workspace")
38
+ end
9
39
  end
@@ -0,0 +1 @@
1
+ <%= icon_set.gwt.qualified_helper_name %>
@@ -0,0 +1,74 @@
1
+ require File.expand_path('../../helper', __FILE__)
2
+
3
+ class Reality::Mda::TestCore < Reality::Mda::TestCase
4
+ def test_define_system_using_defaults
5
+ module_type = Reality::Mda.define_system(TestModule) do |r|
6
+ r.model_element(:icon_set)
7
+ r.model_element(:icon, :icon_set)
8
+ end
9
+
10
+ assert_equal TestModule, module_type
11
+
12
+ assert_true TestModule.const_defined?(:Model), 'TestModule::Model defined'
13
+ assert_true TestModule.const_defined?(:FacetManager), 'TestModule::FacetManager defined'
14
+ assert_true TestModule.const_defined?(:TemplateSetManager), 'TestModule::TemplateSetManager defined'
15
+
16
+ # And the models
17
+ assert_true TestModule::Model.const_defined?(:IconSet), 'TestModule::Model::IconSet defined'
18
+ assert_true TestModule::Model.const_defined?(:Icon), 'TestModule::Model::Icon defined'
19
+
20
+ # And the Logging
21
+ assert_true TestModule.const_defined?(:Logger), 'TestModule::Logger defined'
22
+
23
+ TestModule::FacetManager.facet(:gwt) do |facet|
24
+ facet.enhance(TestModule::Model::IconSet) do
25
+ def self.facet_templates_directory
26
+ File.expand_path("#{File.dirname(__FILE__)}/templates")
27
+ end
28
+
29
+ def helper_name
30
+ "#{Reality::Naming.pascal_case(icon_set.name)}Helper"
31
+ end
32
+
33
+ def qualified_helper_name
34
+ "#{Reality::Naming.underscore(icon_set.name)}.helpers.#{helper_name}"
35
+ end
36
+
37
+ java_artifact(:assets, :helper)
38
+ end
39
+ end
40
+
41
+ assert_true TestModule::FacetManager::FacetDefinitions.const_defined?(:GwtIconSetFacet), 'TestModule::FacetManager::FacetDefinitions::GwtIconSetFacet defined'
42
+ assert_false TestModule::FacetManager::FacetDefinitions.const_defined?(:GwtIconFacet), 'TestModule::FacetManager::FacetDefinitions::GwtIconFacet defined'
43
+
44
+ # There is no icon_sets defined yet
45
+ assert_equal 0, TestModule.icon_sets.size
46
+
47
+ # Test model is hooked up correctly
48
+ TestModule.icon_set(:fa) do |s|
49
+ s.enable_facets(:gwt)
50
+ assert_equal 'fa.helpers.FaHelper', s.gwt.qualified_helper_name
51
+ s.icon(:map_marker)
52
+ s.icon(:cross)
53
+ end
54
+
55
+ assert_equal 1, TestModule.icon_sets.size
56
+
57
+ icon_set = TestModule.icon_set_by_name(:fa)
58
+
59
+ assert_equal :fa, icon_set.name
60
+ assert_equal 2, icon_set.icons.size
61
+
62
+ target_dir = self.local_dir
63
+
64
+ TestModule::TemplateSetManager.generator.generate(:icon_set, icon_set, target_dir, [:gwt_assets], nil)
65
+
66
+ generated_file = "#{target_dir}/main/java/fa/helpers/FaHelper.java"
67
+ assert_true File.exist?(generated_file)
68
+ assert_equal "fa.helpers.FaHelper\n",IO.read(generated_file)
69
+
70
+ assert_true TestModule.const_defined?(:Build), 'TestModule::Build defined'
71
+ assert_true TestModule::Build.const_defined?(:GenerateTask), 'TestModule::Build::GenerateTask defined'
72
+ assert_true TestModule::Build.const_defined?(:LoadDescriptor), 'TestModule::Build::LoadDescriptor defined'
73
+ end
74
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reality-mda
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Donald
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.0.0
97
- - !ruby/object:Gem::Dependency
98
- name: reality-facets
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: 1.3.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: 1.3.0
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: minitest
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +142,8 @@ files:
156
142
  - lib/reality/mda/core.rb
157
143
  - reality-mda.gemspec
158
144
  - test/helper.rb
145
+ - test/mda/templates/helper.java.erb
146
+ - test/mda/test_core.rb
159
147
  homepage: https://github.com/realityforge/reality-mda
160
148
  licenses: []
161
149
  metadata: {}