mingle-macro-development-toolkit 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -20,6 +20,8 @@ require File.dirname(__FILE__) + '/lib/macro_development_toolkit'
20
20
  # if ARGV[0] == "repackage"
21
21
 
22
22
  %w[newgem rubigen hoe].each { |f| require f }
23
+ # Hoe.plugin :newgem
24
+ # Hoe.plugin :website
23
25
 
24
26
  # Generate all the Rake tasks
25
27
  # Run 'rake -T' to see list of generated tasks (from gem root directory)
@@ -33,11 +33,12 @@ AUTO_GENERATED_CLASS_NAME_MESSAGE
33
33
  end
34
34
 
35
35
  require 'erb'
36
+ require 'fileutils'
36
37
  begin
37
- require 'activesupport'
38
+ require 'active_support'
38
39
  rescue LoadError
39
40
  require 'rubygems'
40
- require 'activesupport'
41
+ require 'active_support'
41
42
  end
42
43
 
43
44
  def print_usage
@@ -4,7 +4,7 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
5
5
 
6
6
  module MacroDevelopmentToolkit
7
- VERSION = '1.3.1'
7
+ VERSION = '1.3.2'
8
8
  end
9
9
 
10
10
  require 'yaml'
@@ -1,5 +1,5 @@
1
1
  module Mingle
2
- # Copyright 2009 ThoughtWorks, Inc. All rights reserved.
2
+ # Copyright 2010 ThoughtWorks, Inc. All rights reserved.
3
3
 
4
4
  # This is a lightweight representation of the relationship between a card_type
5
5
  # and a property definition as configured in Mingle.
@@ -10,8 +10,8 @@ module Mingle
10
10
 
11
11
  def position
12
12
  @card_type_property_definition.position.to_i
13
- end
14
-
13
+ end
14
+
15
15
  def card_type
16
16
  @card_type_loader.load
17
17
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2009 ThoughtWorks, Inc. All rights reserved.
1
+ # Copyright 2010 ThoughtWorks, Inc. All rights reserved.
2
2
 
3
3
  # MingleModelLoaders understand how to load a graph of lightweight objects from
4
4
  # the Mingle model objects at runtime, when the custom macro is deployed into production.
@@ -73,7 +73,7 @@ module MingleModelLoaders
73
73
  class LoadPropertyDefinitionsByProjectId < Base
74
74
  def load
75
75
  @project.with_active_project do
76
- @project.all_property_definitions.collect do |pd|
76
+ (@project.predefined_property_definitions + @project.all_property_definitions).collect do |pd|
77
77
  property_definition = Mingle::PropertyDefinition.new(pd)
78
78
  property_definition.card_types_property_definitions_loader = card_types_property_definitions_by_property_definition_id_loader(pd.id)
79
79
  property_definition.values_loader = values_by_property_definition_id_loader(pd.id)
@@ -91,7 +91,7 @@ module MingleModelLoaders
91
91
 
92
92
  def load
93
93
  @project.with_active_project do
94
- @project.card_types.find(@card_type_id).card_types_property_definitions.collect do |ctpd|
94
+ @project.card_types.find(@card_type_id).property_type_mappings.collect do |ctpd|
95
95
  card_type_property_definition = Mingle::CardTypePropertyDefinition.new(ctpd)
96
96
  card_type_property_definition.card_type_loader = card_type_by_id_loader(ctpd.card_type_id)
97
97
  card_type_property_definition.property_definition_loader = property_definition_by_id_loader(ctpd.property_definition_id)
@@ -110,7 +110,7 @@ module MingleModelLoaders
110
110
 
111
111
  def load
112
112
  @project.with_active_project do
113
- @project.all_property_definitions.detect { |pd| pd.id == @property_definition_id }.card_types_property_definitions do |ctpd|
113
+ @project.all_property_definitions.detect { |pd| pd.id == @property_definition_id }.property_type_mappings do |ctpd|
114
114
  card_type_property_definition = Mingle::CardTypePropertyDefinition.new(ctpd)
115
115
  card_type_property_definition.card_type_loader = card_type_by_id_loader(ctpd.card_type_id)
116
116
  card_type_property_definition.property_definition_loader = property_definition_by_id_loader(ctpd.property_definition_id)
@@ -0,0 +1,19 @@
1
+ ---
2
+ - position: 3
3
+ property_definition_id: 1141
4
+ color: 'b30600'
5
+ db_identifier: High
6
+ url_identifier: High
7
+ display_value: High
8
+ - position: 2
9
+ property_definition_id: 1141
10
+ color: 'ff6600'
11
+ db_identifier: Medium
12
+ url_identifier: Medium
13
+ display_value: Medium
14
+ - position: 1
15
+ property_definition_id: 1141
16
+ color: 'f1ff26'
17
+ db_identifier: Low
18
+ url_identifier: Low
19
+ display_value: Low
@@ -1,4 +1,4 @@
1
- #Copyright 2008 ThoughtWorks, Inc. All rights reserved.
1
+ #Copyright 2010 ThoughtWorks, Inc. All rights reserved.
2
2
 
3
3
  require 'delegate'
4
4
  require 'test/unit'
@@ -29,7 +29,12 @@ class RestLoaderTest < Test::Unit::TestCase
29
29
  def test_should_load_correct_values_for_property_definitions
30
30
  priority_definition = project(TEST_PROJECT).property_definitions.detect { |pd| pd.name == 'Priority' }
31
31
  assert_equal ['Low', 'Medium', 'High'], priority_definition.values.collect(&:db_identifier)
32
- end
32
+ end
33
+
34
+ def test_should_load_predefined_property_definitions
35
+ assert project(TEST_PROJECT).property_definitions.detect { |pd| pd.name == 'Name' }
36
+ assert project(TEST_PROJECT).property_definitions.detect { |pd| pd.name == 'Number' }
37
+ end
33
38
 
34
39
  def test_should_load_correct_colors_for_values_of_property_definitions
35
40
  priority_definition = project(TEST_PROJECT).property_definitions.detect { |pd| pd.name == 'Priority' }
@@ -1,4 +1,4 @@
1
- #Copyright 2008 ThoughtWorks, Inc. All rights reserved.
1
+ #Copyright 2010 ThoughtWorks, Inc. All rights reserved.
2
2
  require 'erb'
3
3
 
4
4
  module FixtureLoaders
@@ -91,7 +91,7 @@ module FixtureLoaders
91
91
  end
92
92
 
93
93
  def load
94
- load_fixtures_for('card_types_property_definitions').collect do |ctpd|
94
+ load_fixtures_for('property_type_mappings').collect do |ctpd|
95
95
  next unless ctpd['card_type_id'] == @card_type_id
96
96
 
97
97
  card_type_property_definition = Mingle::CardTypePropertyDefinition.new(OpenStruct.new(ctpd))
@@ -110,7 +110,7 @@ module FixtureLoaders
110
110
  end
111
111
 
112
112
  def load
113
- load_fixtures_for('card_types_property_definitions').collect do |ctpd|
113
+ load_fixtures_for('property_type_mappings').collect do |ctpd|
114
114
  next unless ctpd['property_definition_id'] == @property_definition_id
115
115
 
116
116
  card_type_property_definition = Mingle::CardTypePropertyDefinition.new(OpenStruct.new(ctpd))
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 1
9
- version: 1.3.1
8
+ - 2
9
+ version: 1.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - ThoughtWorks Inc
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-02 00:00:00 -07:00
17
+ date: 2010-08-13 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -55,8 +55,8 @@ dependencies:
55
55
  segments:
56
56
  - 2
57
57
  - 6
58
- - 0
59
- version: 2.6.0
58
+ - 1
59
+ version: 2.6.1
60
60
  type: :development
61
61
  version_requirements: *id003
62
62
  description: ""
@@ -72,7 +72,6 @@ extra_rdoc_files:
72
72
  - History.txt
73
73
  - README.rdoc
74
74
  files:
75
- - .specification
76
75
  - getting_started.txt
77
76
  - README.rdoc
78
77
  - LICENSE.txt
@@ -95,10 +94,11 @@ files:
95
94
  - test/integration/integration_test_helper.rb
96
95
  - test/integration/rest_loader_test.rb
97
96
  - test/fixtures/sample/card_types.yml
98
- - test/fixtures/sample/card_types_property_definitions.yml
97
+ - test/fixtures/sample/property_type_mappings.yml
99
98
  - test/fixtures/sample/project_variables.yml
100
99
  - test/fixtures/sample/projects.yml
101
100
  - test/fixtures/sample/property_definitions.yml
101
+ - test/fixtures/sample/property_values.yml
102
102
  - test/fixtures/sample/users.yml
103
103
  - test/project_data/macro_toolkit_test_template.mingle
104
104
  - bin/new_mingle_macro
@@ -1,160 +0,0 @@
1
- --- !ruby/object:Gem::Specification
2
- name: mingle-macro-development-toolkit
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 3
8
- - 1
9
- version: 1.3.1
10
- platform: ruby
11
- authors:
12
- - ThoughtWorks Inc
13
- autorequire:
14
- bindir: bin
15
- cert_chain: []
16
-
17
- date: 2010-03-30 00:00:00 -07:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 0
30
- - 2
31
- version: 2.0.2
32
- type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: rubyforge
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 2
43
- - 0
44
- - 4
45
- version: 2.0.4
46
- type: :development
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: gemcutter
50
- prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 0
57
- - 4
58
- - 1
59
- version: 0.4.1
60
- type: :development
61
- version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
63
- name: hoe
64
- prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- segments:
70
- - 2
71
- - 5
72
- - 0
73
- version: 2.5.0
74
- type: :development
75
- version_requirements: *id004
76
- description: ""
77
- email:
78
- - support@thoughtworks.com
79
- executables:
80
- - new_mingle_macro
81
- extensions: []
82
-
83
- extra_rdoc_files:
84
- - getting_started.txt
85
- - LICENSE.txt
86
- - History.txt
87
- - README.rdoc
88
- files:
89
- - .specification
90
- - getting_started.txt
91
- - README.rdoc
92
- - LICENSE.txt
93
- - History.txt
94
- - Rakefile
95
- - lib/macro_development_toolkit.rb
96
- - lib/macro_development_toolkit/mingle/card_type_property_definition.rb
97
- - lib/macro_development_toolkit/mingle/card_type.rb
98
- - lib/macro_development_toolkit/mingle/project_variable.rb
99
- - lib/macro_development_toolkit/mingle/project.rb
100
- - lib/macro_development_toolkit/mingle/property_definition.rb
101
- - lib/macro_development_toolkit/mingle/property_value.rb
102
- - lib/macro_development_toolkit/mingle/user.rb
103
- - lib/macro_development_toolkit/mingle_model_loader.rb
104
- - tasks/test.rake
105
- - test/unit/fixture_loader.rb
106
- - test/unit/unit_test_helper.rb
107
- - test/unit/fixture_loader_test.rb
108
- - test/integration/rest_loader.rb
109
- - test/integration/integration_test_helper.rb
110
- - test/integration/rest_loader_test.rb
111
- - test/fixtures/sample/card_types.yml
112
- - test/fixtures/sample/card_types_property_definitions.yml
113
- - test/fixtures/sample/project_variables.yml
114
- - test/fixtures/sample/projects.yml
115
- - test/fixtures/sample/property_definitions.yml
116
- - test/fixtures/sample/users.yml
117
- - test/project_data/macro_toolkit_test_template.mingle
118
- - bin/new_mingle_macro
119
- - example/Rakefile
120
- - example/deploy.rake
121
- - example/init.rb
122
- - example/macro.rb
123
- - example/unit_test.rb
124
- - example/unit_test_helper.rb
125
- - example/integration_test.rb
126
- - example/integration_test_helper.rb
127
- has_rdoc: true
128
- homepage:
129
- licenses: []
130
-
131
- post_install_message: getting_started.txt
132
- rdoc_options:
133
- - --main
134
- - README.txt
135
- require_paths:
136
- - lib
137
- required_ruby_version: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- segments:
142
- - 0
143
- version: "0"
144
- required_rubygems_version: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- segments:
149
- - 0
150
- version: "0"
151
- requirements: []
152
-
153
- rubyforge_project: mingle-macros
154
- rubygems_version: 1.3.6
155
- signing_key:
156
- specification_version: 3
157
- summary: This toolkit provides support for developing, testing and deploying custom Mingle macros.
158
- test_files: []
159
-
160
-