moj_tribunals_config 0.8.0 → 1.0.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: c5f6584256f59e97b0fb29846d76c78bbde5edea
4
- data.tar.gz: 4c1cdc203d96d67c3986e325fec6bf9df5c7c0a6
3
+ metadata.gz: 1233d2f0e695bc9ade2a8cf697017068fcf9ea32
4
+ data.tar.gz: be82f47ed17884dbc5182197da556f95098675cc
5
5
  SHA512:
6
- metadata.gz: 5f5d38db5b49e7cf88a9019698cc81b329fbcc1abdf5c29f20396ccf410ae6302ea875eafcfd03f9c266332a2eb3390ab2cffaf2f70ad3b816446ccc7516f934
7
- data.tar.gz: 2aa7144c5fc8038c049909bb4b7697d7a0c70360aeacd6a840fc41dd6b61f8059deb7946359358375ef4abe6367453b38c7f7678cce6ba9941c49037382e999e
6
+ metadata.gz: b6d4d277011b5c155f564091c370962f46e5aeb91130065a56e851f37b196cea3b466c59fbf8201bb12fd4c1df635a7301d94cece6f83e7c68cf046f15a51fe0
7
+ data.tar.gz: 375aa81fa53ac6d44bcaaeafff2668c824bd5664e00a96a32480fdbbb6fb19a2e2a56e288b4bfa2d1bb4718e0e1991283faf58bc4dd795e3f9e3162cdad29f5f
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.5@moj_tribunals_config
data/Gemfile CHANGED
@@ -10,5 +10,10 @@ group :development do
10
10
  gem "rdoc", "~> 3.12"
11
11
  gem "bundler", "~> 1.0"
12
12
  gem "jeweler", "~> 2.0.1"
13
- gem "simplecov", ">= 0"
14
13
  end
14
+
15
+ group :development, :test do
16
+ gem 'byebug'
17
+ gem 'rspec'
18
+ gem "simplecov", ">= 0"
19
+ end
data/Gemfile.lock CHANGED
@@ -9,8 +9,15 @@ GEM
9
9
  tzinfo (~> 1.1)
10
10
  addressable (2.3.6)
11
11
  builder (3.2.2)
12
+ byebug (3.5.1)
13
+ columnize (~> 0.8)
14
+ debugger-linecache (~> 1.2)
15
+ slop (~> 3.6)
16
+ columnize (0.9.0)
17
+ debugger-linecache (1.2.0)
12
18
  descendants_tracker (0.0.4)
13
19
  thread_safe (~> 0.3, >= 0.3.1)
20
+ diff-lcs (1.2.5)
14
21
  docile (1.1.5)
15
22
  faraday (0.9.1)
16
23
  multipart-post (>= 1.2, < 3)
@@ -54,6 +61,18 @@ GEM
54
61
  rake (10.4.2)
55
62
  rdoc (3.12.2)
56
63
  json (~> 1.4)
64
+ rspec (3.1.0)
65
+ rspec-core (~> 3.1.0)
66
+ rspec-expectations (~> 3.1.0)
67
+ rspec-mocks (~> 3.1.0)
68
+ rspec-core (3.1.7)
69
+ rspec-support (~> 3.1.0)
70
+ rspec-expectations (3.1.2)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.1.0)
73
+ rspec-mocks (3.1.3)
74
+ rspec-support (~> 3.1.0)
75
+ rspec-support (3.1.2)
57
76
  shoulda (3.5.0)
58
77
  shoulda-context (~> 1.0, >= 1.0.1)
59
78
  shoulda-matchers (>= 1.4.1, < 3.0)
@@ -65,6 +84,7 @@ GEM
65
84
  multi_json (~> 1.0)
66
85
  simplecov-html (~> 0.8.0)
67
86
  simplecov-html (0.8.0)
87
+ slop (3.6.0)
68
88
  thread_safe (0.3.4)
69
89
  tzinfo (1.2.2)
70
90
  thread_safe (~> 0.1)
@@ -74,7 +94,9 @@ PLATFORMS
74
94
 
75
95
  DEPENDENCIES
76
96
  bundler (~> 1.0)
97
+ byebug
77
98
  jeweler (~> 2.0.1)
78
99
  rdoc (~> 3.12)
100
+ rspec
79
101
  shoulda
80
102
  simplecov
data/README.rdoc CHANGED
@@ -1,5 +1,8 @@
1
1
  = moj_tribunals_config
2
2
 
3
+ {<img src="https://codeclimate.com/github/ministryofjustice/moj_tribunals_config/badges/gpa.svg" />}[https://codeclimate.com/github/ministryofjustice/moj_tribunals_config]
4
+ {<img src="https://codeclimate.com/github/ministryofjustice/moj_tribunals_config/badges/coverage.svg" />}[https://codeclimate.com/github/ministryofjustice/moj_tribunals_config]
5
+
3
6
  == To use:
4
7
 
5
8
  # add this line to your Gemfile:
@@ -24,7 +27,7 @@ To just load config for a specific tribunal, you can do:
24
27
 
25
28
  config_loader = Moj::Tribunals::ConfigLoader.new
26
29
  config_file = config_loader.config_file_for('utiac')
27
- config_loader.load( config_file )
30
+ config_loader.load_file( config_file )
28
31
 
29
32
  == RailsConfig integration
30
33
 
data/Rakefile CHANGED
@@ -40,7 +40,7 @@ Jeweler::Tasks.new do |gem|
40
40
 
41
41
  config_loader = Moj::Tribunals::ConfigLoader.new
42
42
  config_file = config_loader.config_file_for('utiac')
43
- config_loader.load( config_file )
43
+ config_loader.load_file( config_file )
44
44
 
45
45
  RailsConfig integration
46
46
  =======================
@@ -57,20 +57,22 @@ Jeweler::Tasks.new do |gem|
57
57
  end
58
58
  Jeweler::RubygemsDotOrgTasks.new
59
59
 
60
- require 'rake/testtask'
61
- Rake::TestTask.new(:test) do |test|
62
- test.libs << 'lib' << 'test'
63
- test.pattern = 'test/**/test_*.rb'
64
- test.verbose = true
60
+
61
+ begin
62
+ require 'rspec/core/rake_task'
63
+ RSpec::Core::RakeTask.new(:spec)
64
+ rescue LoadError => e
65
+ puts e.inspect
65
66
  end
66
67
 
68
+
67
69
  desc "Code coverage detail"
68
70
  task :simplecov do
69
71
  ENV['COVERAGE'] = "true"
70
- Rake::Task['test'].execute
72
+ Rake::Task['spec'].execute
71
73
  end
72
74
 
73
- task :default => :test
75
+ task :default => :spec
74
76
 
75
77
  require 'rdoc/task'
76
78
  Rake::RDocTask.new do |rdoc|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 1.0.0
@@ -1,113 +1,112 @@
1
- tribunal:
2
- name: care-standards
3
- title: Care Standards Tribunal
4
- search_params:
5
- - query
6
- - search_field
7
- - reported
8
- - unreported
9
- - country_guidance
10
- - page
11
- - sort_by
12
- - judge_ids
13
- - country_ids
14
- - category_ids
15
- - date_from
16
- - date_to
17
- allowed_snippet_tags:
18
- - mark
19
- - br
20
- sort_columns:
21
- promulgated_on:
22
- directions:
23
- desc:
24
- text: Newest first
25
- _score:
26
- directions:
27
- desc:
28
- text: Relevance
29
- date_facet_help_text: A judgement can be used as case law from the promulgation date.
30
- facets:
31
- category:
32
- text: Schedule
33
- collection: categories
34
- ids: category_ids
35
- all_link_text: All Schedules
36
- help_text:
37
- judge:
38
- text: Chairman
39
- collection: judges
40
- ids: judge_ids
41
- all_link_text: All Chairman
42
- help_text:
43
- table_view_properties:
44
- appeal_number:
45
- property: appeal_number
46
- text: Appeal number
47
- chairman:
48
- property: judges
49
- text: Chairman
50
- formatters:
51
- fetch:
52
- method_name: fetch
53
- args: "name"
54
- applicant:
55
- property: appellants
56
- text: Applicant names
57
- formatters:
58
- fetch:
59
- method_name: fetch
60
- args: "name"
61
- respondent:
62
- property: respondents
63
- text: Respondent names
64
- formatters:
65
- fetch:
66
- method_name: fetch
67
- args: "name"
68
- category:
69
- property: categories
70
- text: Schedule
71
- formatters:
72
- fetch:
73
- method_name: fetch
74
- args: "name"
75
- decision_date:
76
- property: promulgated_on
77
- text: Promulgation date
78
- formatters:
79
- to_date:
80
- method_name: to_date
81
- args:
82
- strftime:
83
- method_name: strftime
84
- args: "%d/%m/%Y"
85
- detail_view_properties:
86
- appeal_number:
87
- property: appeal_number
88
- text: Appeal number
89
- chairman:
90
- property: judge_names
91
- text: Chairman
92
- applicant:
93
- property: appellant_names
94
- text: Applicant names
95
- respondent:
96
- property: respondent_names
97
- text: Respondent names
98
- category:
99
- property: category_names
100
- text: Schedule
101
- decision_date:
102
- property: promulgated_on
103
- text: Promulgation date
104
- formatters:
105
- to_date:
106
- method_name: to_date
107
- args:
108
- strftime:
109
- method_name: strftime
110
- args: "%d/%m/%Y"
111
- notes:
112
- property: notes
113
- text: Notes
1
+ name: care-standards
2
+ title: Care Standards Tribunal
3
+ search_params:
4
+ - query
5
+ - search_field
6
+ - reported
7
+ - unreported
8
+ - country_guidance
9
+ - page
10
+ - sort_by
11
+ - judge_ids
12
+ - country_ids
13
+ - category_ids
14
+ - date_from
15
+ - date_to
16
+ allowed_snippet_tags:
17
+ - mark
18
+ - br
19
+ sort_columns:
20
+ promulgated_on:
21
+ directions:
22
+ desc:
23
+ text: Newest first
24
+ _score:
25
+ directions:
26
+ desc:
27
+ text: Relevance
28
+ date_facet_help_text: A judgement can be used as case law from the promulgation date.
29
+ facets:
30
+ category:
31
+ text: Schedule
32
+ collection: categories
33
+ ids: category_ids
34
+ all_link_text: All Schedules
35
+ help_text:
36
+ judge:
37
+ text: Chairman
38
+ collection: judges
39
+ ids: judge_ids
40
+ all_link_text: All Chairman
41
+ help_text:
42
+ table_view_properties:
43
+ appeal_number:
44
+ property: appeal_number
45
+ text: Appeal number
46
+ chairman:
47
+ property: judges
48
+ text: Chairman
49
+ formatters:
50
+ fetch:
51
+ method_name: fetch
52
+ args: "name"
53
+ applicant:
54
+ property: appellants
55
+ text: Applicant names
56
+ formatters:
57
+ fetch:
58
+ method_name: fetch
59
+ args: "name"
60
+ respondent:
61
+ property: respondents
62
+ text: Respondent names
63
+ formatters:
64
+ fetch:
65
+ method_name: fetch
66
+ args: "name"
67
+ category:
68
+ property: categories
69
+ text: Schedule
70
+ formatters:
71
+ fetch:
72
+ method_name: fetch
73
+ args: "name"
74
+ decision_date:
75
+ property: promulgated_on
76
+ text: Promulgation date
77
+ formatters:
78
+ to_date:
79
+ method_name: to_date
80
+ args:
81
+ strftime:
82
+ method_name: strftime
83
+ args: "%d/%m/%Y"
84
+ detail_view_properties:
85
+ appeal_number:
86
+ property: appeal_number
87
+ text: Appeal number
88
+ chairman:
89
+ property: judge_names
90
+ text: Chairman
91
+ applicant:
92
+ property: appellant_names
93
+ text: Applicant names
94
+ respondent:
95
+ property: respondent_names
96
+ text: Respondent names
97
+ category:
98
+ property: category_names
99
+ text: Schedule
100
+ decision_date:
101
+ property: promulgated_on
102
+ text: Promulgation date
103
+ formatters:
104
+ to_date:
105
+ method_name: to_date
106
+ args:
107
+ strftime:
108
+ method_name: strftime
109
+ args: "%d/%m/%Y"
110
+ notes:
111
+ property: notes
112
+ text: Notes
@@ -1,79 +1,78 @@
1
- tribunal:
2
- name: eat
3
- title: Employment Access Tribunal
4
- search_params:
5
- - query
6
- - search_field
7
- - reported
8
- - unreported
9
- - country_guidance
10
- - page
11
- - sort_by
12
- - judge_ids
13
- - country_ids
14
- - category_ids
15
- - date_from
16
- - date_to
17
- allowed_snippet_tags:
18
- - mark
19
- - br
20
- sort_columns:
21
- promulgated_on:
22
- directions:
23
- desc:
24
- text: Newest first
25
- _score:
26
- directions:
27
- desc:
28
- text: Relevance
29
- facets:
30
- country:
31
- text: Country
32
- collection: countries
33
- ids: country_ids
34
- all_link_text: All Countries
35
- judge:
36
- text: Judge
37
- collection: judges
38
- ids: judge_ids
39
- all_link_text: All Judges
40
- tabs:
41
- reported:
42
- text: Reported
43
- count_method: reported_count
44
- default: true
45
- country_guidance:
46
- text: Country Guidance
47
- count_method: country_guidance_count
48
- default: false
49
- unreported:
50
- text: Unreported
51
- count_method: unreported_count
52
- default: false
53
- table_view_properties:
54
- case_title:
55
- property: case_title
56
- text: Case title
57
- keywords:
58
- property: keywords
59
- text: Keywords
60
- promulgated_on:
61
- property: promulgated_on
62
- text: Promulgation date
63
- formatters:
64
- to_date:
65
- method_name: to_date
66
- args:
67
- strftime:
68
- method_name: strftime
69
- args: "%d/%m/%Y"
70
- country_name:
71
- property: country_name
72
- text: Country of Appellant
73
- keywords:
74
- property: keywords
75
- text: keywords
76
- detail_view_properties:
77
- case_title:
78
- property: case_title
79
- text: Case title
1
+ name: eat
2
+ title: Employment Access Tribunal
3
+ search_params:
4
+ - query
5
+ - search_field
6
+ - reported
7
+ - unreported
8
+ - country_guidance
9
+ - page
10
+ - sort_by
11
+ - judge_ids
12
+ - country_ids
13
+ - category_ids
14
+ - date_from
15
+ - date_to
16
+ allowed_snippet_tags:
17
+ - mark
18
+ - br
19
+ sort_columns:
20
+ promulgated_on:
21
+ directions:
22
+ desc:
23
+ text: Newest first
24
+ _score:
25
+ directions:
26
+ desc:
27
+ text: Relevance
28
+ facets:
29
+ country:
30
+ text: Country
31
+ collection: countries
32
+ ids: country_ids
33
+ all_link_text: All Countries
34
+ judge:
35
+ text: Judge
36
+ collection: judges
37
+ ids: judge_ids
38
+ all_link_text: All Judges
39
+ tabs:
40
+ reported:
41
+ text: Reported
42
+ count_method: reported_count
43
+ default: true
44
+ country_guidance:
45
+ text: Country Guidance
46
+ count_method: country_guidance_count
47
+ default: false
48
+ unreported:
49
+ text: Unreported
50
+ count_method: unreported_count
51
+ default: false
52
+ table_view_properties:
53
+ case_title:
54
+ property: case_title
55
+ text: Case title
56
+ keywords:
57
+ property: keywords
58
+ text: Keywords
59
+ promulgated_on:
60
+ property: promulgated_on
61
+ text: Promulgation date
62
+ formatters:
63
+ to_date:
64
+ method_name: to_date
65
+ args:
66
+ strftime:
67
+ method_name: strftime
68
+ args: "%d/%m/%Y"
69
+ country_name:
70
+ property: country_name
71
+ text: Country of Appellant
72
+ keywords:
73
+ property: keywords
74
+ text: keywords
75
+ detail_view_properties:
76
+ case_title:
77
+ property: case_title
78
+ text: Case title
@@ -1,99 +1,98 @@
1
- tribunal:
2
- name: ftt-tax
3
- title: Finance and Tax Tribunals
4
- search_params:
5
- - query
6
- - search_field
7
- - reported
8
- - unreported
9
- - country_guidance
10
- - page
11
- - sort_by
12
- - judge_ids
13
- - category_ids
14
- - date_from
15
- - date_to
16
- allowed_snippet_tags:
17
- - mark
18
- - br
19
- sort_columns:
20
- promulgated_on:
21
- directions:
22
- desc:
23
- text: Newest first
24
- _score:
25
- directions:
26
- desc:
27
- text: Relevance
28
- date_facet_help_text: A judgement can be used as case law from the promulgation date.
29
- facets:
30
- category:
31
- text: Category
32
- collection: categories
33
- ids: category_ids
34
- all_link_text: All Categories
35
- help_text:
36
- judge:
37
- text: Judge
38
- collection: judges
39
- ids: judge_ids
40
- all_link_text: All Judges
41
- help_text:
42
- table_view_properties:
43
- case_title:
44
- property: case_title
45
- text: Case title
46
- file_number:
47
- property: decision_number
48
- text: File number
49
- category:
50
- property: category_names
51
- text: Category
52
- sub_category:
53
- property: subcategory_names
54
- text: Sub-category
55
- promulgated_on:
56
- property: promulgated_on
57
- text: Promulgation date
58
- formatters:
59
- to_date:
60
- method_name: to_date
61
- args:
62
- strftime:
63
- method_name: strftime
64
- args: "%d/%m/%Y"
65
- detail_view_properties:
66
- judges:
67
- property: judge_names
68
- text: Judges
69
- appellants:
70
- property: appellant_names
71
- text: Appellants
72
- respondents:
73
- property: respondent_names
74
- text: Respondents
75
- category:
76
- property: category_names
77
- text: Category
78
- sub_category:
79
- property: subcategory_names
80
- text: Sub-category
81
- appeal_number:
82
- property: appeal_number
83
- text: Appeal number
84
- file_number:
85
- property: decision_number
86
- text: File number
87
- promulgated_on:
88
- property: promulgated_on
89
- text: Promulgation date
90
- formatters:
91
- to_date:
92
- method_name: to_date
93
- args:
94
- strftime:
95
- method_name: strftime
96
- args: "%d/%m/%Y"
97
- notes:
98
- property: notes
99
- text: Notes
1
+ name: ftt-tax
2
+ title: Finance and Tax Tribunals
3
+ search_params:
4
+ - query
5
+ - search_field
6
+ - reported
7
+ - unreported
8
+ - country_guidance
9
+ - page
10
+ - sort_by
11
+ - judge_ids
12
+ - category_ids
13
+ - date_from
14
+ - date_to
15
+ allowed_snippet_tags:
16
+ - mark
17
+ - br
18
+ sort_columns:
19
+ promulgated_on:
20
+ directions:
21
+ desc:
22
+ text: Newest first
23
+ _score:
24
+ directions:
25
+ desc:
26
+ text: Relevance
27
+ date_facet_help_text: A judgement can be used as case law from the promulgation date.
28
+ facets:
29
+ category:
30
+ text: Category
31
+ collection: categories
32
+ ids: category_ids
33
+ all_link_text: All Categories
34
+ help_text:
35
+ judge:
36
+ text: Judge
37
+ collection: judges
38
+ ids: judge_ids
39
+ all_link_text: All Judges
40
+ help_text:
41
+ table_view_properties:
42
+ case_title:
43
+ property: case_title
44
+ text: Case title
45
+ file_number:
46
+ property: decision_number
47
+ text: File number
48
+ category:
49
+ property: category_names
50
+ text: Category
51
+ sub_category:
52
+ property: subcategory_names
53
+ text: Sub-category
54
+ promulgated_on:
55
+ property: promulgated_on
56
+ text: Promulgation date
57
+ formatters:
58
+ to_date:
59
+ method_name: to_date
60
+ args:
61
+ strftime:
62
+ method_name: strftime
63
+ args: "%d/%m/%Y"
64
+ detail_view_properties:
65
+ judges:
66
+ property: judge_names
67
+ text: Judges
68
+ appellants:
69
+ property: appellant_names
70
+ text: Appellants
71
+ respondents:
72
+ property: respondent_names
73
+ text: Respondents
74
+ category:
75
+ property: category_names
76
+ text: Category
77
+ sub_category:
78
+ property: subcategory_names
79
+ text: Sub-category
80
+ appeal_number:
81
+ property: appeal_number
82
+ text: Appeal number
83
+ file_number:
84
+ property: decision_number
85
+ text: File number
86
+ promulgated_on:
87
+ property: promulgated_on
88
+ text: Promulgation date
89
+ formatters:
90
+ to_date:
91
+ method_name: to_date
92
+ args:
93
+ strftime:
94
+ method_name: strftime
95
+ args: "%d/%m/%Y"
96
+ notes:
97
+ property: notes
98
+ text: Notes
@@ -1,119 +1,118 @@
1
- tribunal:
2
- name: utiac
3
- title: Upper Tribunal Immigration and Asylum Chamber
4
- search_params:
5
- - query
6
- - search_field
7
- - reported
8
- - unreported
9
- - country_guidance
10
- - page
11
- - sort_by
12
- - judge_ids
13
- - country_ids
14
- - date_from
15
- - date_to
16
- allowed_snippet_tags:
17
- - mark
18
- - br
19
- sort_columns:
20
- promulgated_on:
21
- directions:
22
- desc:
23
- text: Newest first
24
- _score:
25
- directions:
26
- desc:
27
- text: Relevance
28
- date_facet_help_text: A judgement can be used as case law from the promulgation date.
29
- facets:
30
- country:
31
- text: Country
32
- collection: countries
33
- ids: country_ids
34
- all_link_text: All Countries
35
- help_text:
36
- judge:
37
- text: Judge
38
- collection: judges
39
- ids: judge_ids
40
- all_link_text: All Judges
41
- tabs:
42
- reported:
43
- text: Reported
44
- count_method: reported_count
45
- default: true
46
- help_text:
47
- country_guidance:
48
- text: Country Guidance
49
- count_method: country_guidance_count
50
- default: false
51
- help_text:
52
- unreported:
53
- text: Unreported
54
- count_method: unreported_count
55
- default: false
56
- help_text:
57
- table_view_properties:
58
- case_title:
59
- property: case_title
60
- text: Case title
61
- keywords:
62
- property: keywords
63
- text: Keywords
64
- promulgated_on:
65
- property: promulgated_on
66
- text: Promulgation date
67
- formatters:
68
- to_date:
69
- method_name: to_date
70
- args:
71
- strftime:
72
- method_name: strftime
73
- args: "%d/%m/%Y"
74
- country_name:
75
- property: country_name
76
- text: Country of Appellant
77
- keywords:
78
- property: keywords
79
- text: Keywords
80
- detail_view_properties:
81
- appeal_number:
82
- property: appeal_number
83
- text: Appeal number
84
- ncn:
85
- property: ncn
86
- text: Neutral Citation Number
87
- Status:
88
- property: status
89
- text: Status
90
- country_name:
91
- property: country_name
92
- text: Country
93
- country_guidance:
94
- property: country_guidance
95
- text: Used as country guidance
96
- formatters:
97
- present?:
98
- method_name: present?
99
- humanize:
100
- method_name: humanize
101
- keywords:
102
- property: keywords
103
- text: Keywords
104
- judges:
105
- property: judge_names
106
- text: Judges
107
- hearing_date:
108
- property: hearing_date
109
- text: Hearing Date
110
- promulgated_on:
111
- property: promulgated_on
112
- text: Promulgation date
113
- formatters:
114
- to_date:
115
- method_name: to_date
116
- args:
117
- strftime:
118
- method_name: strftime
119
- args: "%d/%m/%Y"
1
+ name: utiac
2
+ title: Upper Tribunal Immigration and Asylum Chamber
3
+ search_params:
4
+ - query
5
+ - search_field
6
+ - reported
7
+ - unreported
8
+ - country_guidance
9
+ - page
10
+ - sort_by
11
+ - judge_ids
12
+ - country_ids
13
+ - date_from
14
+ - date_to
15
+ allowed_snippet_tags:
16
+ - mark
17
+ - br
18
+ sort_columns:
19
+ promulgated_on:
20
+ directions:
21
+ desc:
22
+ text: Newest first
23
+ _score:
24
+ directions:
25
+ desc:
26
+ text: Relevance
27
+ date_facet_help_text: A judgement can be used as case law from the promulgation date.
28
+ facets:
29
+ country:
30
+ text: Country
31
+ collection: countries
32
+ ids: country_ids
33
+ all_link_text: All Countries
34
+ help_text:
35
+ judge:
36
+ text: Judge
37
+ collection: judges
38
+ ids: judge_ids
39
+ all_link_text: All Judges
40
+ tabs:
41
+ reported:
42
+ text: Reported
43
+ count_method: reported_count
44
+ default: true
45
+ help_text:
46
+ country_guidance:
47
+ text: Country Guidance
48
+ count_method: country_guidance_count
49
+ default: false
50
+ help_text:
51
+ unreported:
52
+ text: Unreported
53
+ count_method: unreported_count
54
+ default: false
55
+ help_text:
56
+ table_view_properties:
57
+ case_title:
58
+ property: case_title
59
+ text: Case title
60
+ keywords:
61
+ property: keywords
62
+ text: Keywords
63
+ promulgated_on:
64
+ property: promulgated_on
65
+ text: Promulgation date
66
+ formatters:
67
+ to_date:
68
+ method_name: to_date
69
+ args:
70
+ strftime:
71
+ method_name: strftime
72
+ args: "%d/%m/%Y"
73
+ country_name:
74
+ property: country_name
75
+ text: Country of Appellant
76
+ keywords:
77
+ property: keywords
78
+ text: Keywords
79
+ detail_view_properties:
80
+ appeal_number:
81
+ property: appeal_number
82
+ text: Appeal number
83
+ ncn:
84
+ property: ncn
85
+ text: Neutral Citation Number
86
+ Status:
87
+ property: status
88
+ text: Status
89
+ country_name:
90
+ property: country_name
91
+ text: Country
92
+ country_guidance:
93
+ property: country_guidance
94
+ text: Used as country guidance
95
+ formatters:
96
+ present?:
97
+ method_name: present?
98
+ humanize:
99
+ method_name: humanize
100
+ keywords:
101
+ property: keywords
102
+ text: Keywords
103
+ judges:
104
+ property: judge_names
105
+ text: Judges
106
+ hearing_date:
107
+ property: hearing_date
108
+ text: Hearing Date
109
+ promulgated_on:
110
+ property: promulgated_on
111
+ text: Promulgation date
112
+ formatters:
113
+ to_date:
114
+ method_name: to_date
115
+ args:
116
+ strftime:
117
+ method_name: strftime
118
+ args: "%d/%m/%Y"
@@ -27,14 +27,19 @@ module Moj
27
27
  Dir.glob(File.join(config_path, '*.yml'))
28
28
  end
29
29
 
30
- private
30
+ def load_file(file)
31
+ YAML.load_file(file)
32
+ end
31
33
 
32
- def load_file(file)
33
- YAML.load_file(file)
34
- end
34
+ private
35
35
 
36
36
  def default_config_path
37
- File.join( File.dirname(__FILE__), '..', '..', '..', 'config', 'tribunals' )
37
+ File.expand_path(
38
+ File.join(
39
+ File.dirname(__FILE__),
40
+ '..', '..', '..', 'config', 'tribunals'
41
+ )
42
+ )
38
43
  end
39
44
  end
40
45
  end
@@ -2,17 +2,17 @@
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: moj_tribunals_config 0.8.0 ruby lib
5
+ # stub: moj_tribunals_config 1.0.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "moj_tribunals_config"
9
- s.version = "0.8.0"
9
+ s.version = "1.0.0"
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"]
13
13
  s.authors = ["Al Davidson"]
14
- s.date = "2015-02-02"
15
- s.description = "Used by tribunals_frontend and tribunals_api to share configuration.\n To use:\n\n 1) add \"gem 'moj_tribunals_config'\" to your Gemfile\n 2) in an initializer, add the following code:\n\n require 'moj_tribunals_config'\n\n my_config = Moj::Tribunals::ConfigLoader.new.load\n\n This will load the default config files from the gem.\n\n\n To load different files, you can provide an alternative path \n to the ConfigLoader.new method, e.g.\n\n my_config = Moj::Tribunals::ConfigLoader.new('/my/alternative/config/path').load\n\n To just load config for a specific tribunal, you can do:\n\n config_loader = Moj::Tribunals::ConfigLoader.new\n config_file = config_loader.config_file_for('utiac')\n config_loader.load( config_file )\n\n RailsConfig integration\n =======================\n\n If you're using the RailsConfig gem, your intializer can just do something like:\n\n files = Moj::Tribunals::ConfigLoader.new.config_files\n files.each{ |f| Settings.add_source!( f ) }\n Settings.reload!\n "
14
+ s.date = "2015-02-03"
15
+ s.description = "Used by tribunals_frontend and tribunals_api to share configuration.\n To use:\n\n 1) add \"gem 'moj_tribunals_config'\" to your Gemfile\n 2) in an initializer, add the following code:\n\n require 'moj_tribunals_config'\n\n my_config = Moj::Tribunals::ConfigLoader.new.load\n\n This will load the default config files from the gem.\n\n\n To load different files, you can provide an alternative path \n to the ConfigLoader.new method, e.g.\n\n my_config = Moj::Tribunals::ConfigLoader.new('/my/alternative/config/path').load\n\n To just load config for a specific tribunal, you can do:\n\n config_loader = Moj::Tribunals::ConfigLoader.new\n config_file = config_loader.config_file_for('utiac')\n config_loader.load_file( config_file )\n\n RailsConfig integration\n =======================\n\n If you're using the RailsConfig gem, your intializer can just do something like:\n\n files = Moj::Tribunals::ConfigLoader.new.config_files\n files.each{ |f| Settings.add_source!( f ) }\n Settings.reload!\n "
16
16
  s.email = "apdavidson@gmail.com"
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  ]
21
21
  s.files = [
22
22
  ".document",
23
+ ".ruby-version",
23
24
  "Gemfile",
24
25
  "Gemfile.lock",
25
26
  "LICENSE.txt",
@@ -33,8 +34,8 @@ Gem::Specification.new do |s|
33
34
  "lib/moj/tribunals/config_loader.rb",
34
35
  "lib/moj_tribunals_config.rb",
35
36
  "moj_tribunals_config.gemspec",
36
- "test/helper.rb",
37
- "test/test_moj_tribunals_config.rb"
37
+ "spec/lib/moj/tribunals/config_loader_spec.rb",
38
+ "spec/spec_helper.rb"
38
39
  ]
39
40
  s.homepage = "http://github.com/aldavidson/moj_tribunals_config"
40
41
  s.licenses = ["MIT"]
@@ -49,12 +50,16 @@ Gem::Specification.new do |s|
49
50
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
50
51
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
52
  s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
53
+ s.add_development_dependency(%q<byebug>, [">= 0"])
54
+ s.add_development_dependency(%q<rspec>, [">= 0"])
52
55
  s.add_development_dependency(%q<simplecov>, [">= 0"])
53
56
  else
54
57
  s.add_dependency(%q<shoulda>, [">= 0"])
55
58
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
56
59
  s.add_dependency(%q<bundler>, ["~> 1.0"])
57
60
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
61
+ s.add_dependency(%q<byebug>, [">= 0"])
62
+ s.add_dependency(%q<rspec>, [">= 0"])
58
63
  s.add_dependency(%q<simplecov>, [">= 0"])
59
64
  end
60
65
  else
@@ -62,6 +67,8 @@ Gem::Specification.new do |s|
62
67
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
63
68
  s.add_dependency(%q<bundler>, ["~> 1.0"])
64
69
  s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
70
+ s.add_dependency(%q<byebug>, [">= 0"])
71
+ s.add_dependency(%q<rspec>, [">= 0"])
65
72
  s.add_dependency(%q<simplecov>, [">= 0"])
66
73
  end
67
74
  end
@@ -0,0 +1,90 @@
1
+ require 'spec_helper'
2
+ require 'moj/tribunals/config_loader'
3
+
4
+
5
+ describe Moj::Tribunals::ConfigLoader do
6
+ describe '#initialize' do
7
+ context 'with no arguments' do
8
+ it 'defaults the config_path to default_config_path' do
9
+ expect(subject.config_path).to eq(subject.send(:default_config_path))
10
+ end
11
+ end
12
+ context 'given a config_path' do
13
+ let(:config_path){ '/my/config_path' }
14
+ subject{ Moj::Tribunals::ConfigLoader.new(config_path) }
15
+
16
+ it 'stores the given config_path' do
17
+ expect( subject.config_path ).to eq(config_path)
18
+ end
19
+ end
20
+ end
21
+
22
+ describe '#default_config_path' do
23
+ let(:path_to_config){ File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'config', 'tribunals') }
24
+ let(:resolved_path_to_config){ File.expand_path( path_to_config ) }
25
+
26
+ it 'is the full path to the config/tribunals folder' do
27
+ expect(subject.send(:default_config_path)).to eq(resolved_path_to_config)
28
+ end
29
+ end
30
+
31
+ describe '#load_file' do
32
+ it 'loads the given file as YAML' do
33
+ expect(YAML).to receive(:load_file).with('/my/file')
34
+ subject.send(:load_file, '/my/file')
35
+ end
36
+
37
+ it 'returns the result of parsing the given file as YAML' do
38
+ allow(YAML).to receive(:load_file).with('/my/file').and_return( {key: 'value'} )
39
+ expect(subject.send(:load_file, '/my/file')).to eq({key: 'value'})
40
+ end
41
+ end
42
+
43
+ describe '#config_files' do
44
+ it 'returns all YAML files in the config folder' do
45
+ expect(subject.config_files.sort.map{|f| File.basename(f) } ).to eq(['care-standards.yml', 'eat.yml', 'ftt-tax.yml', 'utiac.yml'])
46
+ end
47
+ end
48
+
49
+ describe '#config_file_for' do
50
+ context 'given a tribunal name that exists as a config file' do
51
+ let(:tribunal){ 'ftt-tax' }
52
+
53
+ it 'returns the full path to the corresponding config file' do
54
+ expect(subject.config_file_for(tribunal)).to eq(File.join(subject.send(:config_path), "#{tribunal}.yml"))
55
+ end
56
+ end
57
+
58
+ context 'given a tribunal name that exists as a config file' do
59
+ let(:tribunal){ 'non_existent_tribunal' }
60
+
61
+ it 'returns the full path to the corresponding config file' do
62
+ expect(subject.config_file_for(tribunal)).to be_nil
63
+ end
64
+ end
65
+ end
66
+
67
+ describe '#load' do
68
+ it 'returns a hash' do
69
+ expect(subject.load).to be_a(Hash)
70
+ end
71
+
72
+ describe 'the returned Hash' do
73
+ let(:result){ subject.load }
74
+
75
+ describe 'each tribunal' do
76
+ let(:tribunals){ [:'care-standards', :eat, :'ftt-tax', :utiac] }
77
+
78
+ it 'has a top-level key' do
79
+ expect(result.keys).to eq( tribunals )
80
+ end
81
+
82
+ it 'has second-level keys for each value in the YAML file' do
83
+ tribunals.each do |tribunal|
84
+ expect(result[tribunal].keys.map(&:to_sym)).to include( :name, :title, :search_params )
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,4 @@
1
+ require 'rspec'
2
+
3
+ require 'simplecov'
4
+ SimpleCov.start
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moj_tribunals_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Al Davidson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.0.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: byebug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: simplecov
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +116,7 @@ description: "Used by tribunals_frontend and tribunals_api to share configuratio
88
116
  an alternative path \n to the ConfigLoader.new method, e.g.\n\n my_config
89
117
  = Moj::Tribunals::ConfigLoader.new('/my/alternative/config/path').load\n\n To
90
118
  just load config for a specific tribunal, you can do:\n\n config_loader = Moj::Tribunals::ConfigLoader.new\n
91
- \ config_file = config_loader.config_file_for('utiac')\n config_loader.load(
119
+ \ config_file = config_loader.config_file_for('utiac')\n config_loader.load_file(
92
120
  config_file )\n\n RailsConfig integration\n =======================\n\n If
93
121
  you're using the RailsConfig gem, your intializer can just do something like:\n\n
94
122
  \ files = Moj::Tribunals::ConfigLoader.new.config_files\n files.each{ |f| Settings.add_source!(
@@ -101,6 +129,7 @@ extra_rdoc_files:
101
129
  - README.rdoc
102
130
  files:
103
131
  - ".document"
132
+ - ".ruby-version"
104
133
  - Gemfile
105
134
  - Gemfile.lock
106
135
  - LICENSE.txt
@@ -114,8 +143,8 @@ files:
114
143
  - lib/moj/tribunals/config_loader.rb
115
144
  - lib/moj_tribunals_config.rb
116
145
  - moj_tribunals_config.gemspec
117
- - test/helper.rb
118
- - test/test_moj_tribunals_config.rb
146
+ - spec/lib/moj/tribunals/config_loader_spec.rb
147
+ - spec/spec_helper.rb
119
148
  homepage: http://github.com/aldavidson/moj_tribunals_config
120
149
  licenses:
121
150
  - MIT
data/test/helper.rb DELETED
@@ -1,34 +0,0 @@
1
- require 'simplecov'
2
-
3
- module SimpleCov::Configuration
4
- def clean_filters
5
- @filters = []
6
- end
7
- end
8
-
9
- SimpleCov.configure do
10
- clean_filters
11
- load_adapter 'test_frameworks'
12
- end
13
-
14
- ENV["COVERAGE"] && SimpleCov.start do
15
- add_filter "/.rvm/"
16
- end
17
- require 'rubygems'
18
- require 'bundler'
19
- begin
20
- Bundler.setup(:default, :development)
21
- rescue Bundler::BundlerError => e
22
- $stderr.puts e.message
23
- $stderr.puts "Run `bundle install` to install missing gems"
24
- exit e.status_code
25
- end
26
- require 'test/unit'
27
- require 'shoulda'
28
-
29
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
30
- $LOAD_PATH.unshift(File.dirname(__FILE__))
31
- require 'moj_tribunals_config'
32
-
33
- class Test::Unit::TestCase
34
- end
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestMojTribunalsConfig < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end