alf-core 0.13.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,9 @@
1
- # 0.13.0 / FIX ME
1
+ # 0.13.1 / 2013-08-05
2
+
3
+ * Empty lines are silently ignored by .rash reader
4
+ * Added Viewpoint#members
5
+
6
+ # 0.13.0 / 2013-07-29
2
7
 
3
8
  The 0.13.0 version is a new birthday for alf. See `alf` main for CHANGELOG
4
9
  history.
@@ -4,7 +4,7 @@ module Alf
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 13
7
- TINY = 0
7
+ TINY = 1
8
8
 
9
9
  def self.to_s
10
10
  [ MAJOR, MINOR, TINY ].join('.')
@@ -22,4 +22,4 @@ module Alf
22
22
 
23
23
  end # class Options
24
24
  end # class Database
25
- end # module Alf
25
+ end # module Alf
@@ -15,11 +15,12 @@ module Alf
15
15
 
16
16
  # (see Reader#line2tuple)
17
17
  def line2tuple(line)
18
+ return nil if line.strip.empty?
18
19
  begin
19
20
  h = Kernel.eval(line)
20
- raise "Tuple expected, got #{h}" unless TupleLike===h
21
+ raise "Tuple expected, got `#{h.inspect}`" unless TupleLike===h
21
22
  rescue Exception => ex
22
- $stderr << "Skipping #{line.strip}: #{ex.message}\n"
23
+ $stderr << "Skipping `#{line.strip}`: #{ex.message}\n"
23
24
  nil
24
25
  else
25
26
  return h
@@ -22,6 +22,14 @@ module Alf
22
22
  Lang::Lispy.new(viewpoints, connection)
23
23
  end
24
24
  end
25
+
26
+ def members
27
+ @members ||= []
28
+ end
29
+
30
+ def method_added(m)
31
+ super.tap{ members << m }
32
+ end
25
33
  end
26
34
  extend ClassMethods
27
35
 
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+ module Alf
3
+ describe Viewpoint, "members" do
4
+
5
+ subject{ viewpoint.members }
6
+
7
+ context 'on a base viewpoint' do
8
+ let(:viewpoint){
9
+ Module.new{
10
+ include Alf::Viewpoint
11
+ native :a_native_one
12
+ def restricted
13
+ restrict(a_native_one, id: 1)
14
+ end
15
+ }
16
+ }
17
+
18
+ it 'should have expected members' do
19
+ subject.should eq([:a_native_one, :restricted])
20
+ end
21
+ end
22
+
23
+ end
24
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alf-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-29 00:00:00.000000000 Z
12
+ date: 2013-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -972,6 +972,7 @@ files:
972
972
  - spec/unit/alf-update/inserter/test_var_ref.rb
973
973
  - spec/unit/alf-update/inserter/test_wrap.rb
974
974
  - spec/unit/alf-update/updater/test_var_ref.rb
975
+ - spec/unit/alf-viewpoint/test_members.rb
975
976
  - spec/unit/alf-viewpoint/test_namespace.rb
976
977
  - spec/unit/alf-viewpoint/test_native.rb
977
978
  - spec/unit/alf-viewpoint/test_native_const.rb
@@ -992,7 +993,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
992
993
  version: '0'
993
994
  segments:
994
995
  - 0
995
- hash: 3765047639265520492
996
+ hash: -3410216638395775327
996
997
  required_rubygems_version: !ruby/object:Gem::Requirement
997
998
  none: false
998
999
  requirements:
@@ -1536,6 +1537,7 @@ test_files:
1536
1537
  - spec/unit/alf-update/inserter/test_var_ref.rb
1537
1538
  - spec/unit/alf-update/inserter/test_wrap.rb
1538
1539
  - spec/unit/alf-update/updater/test_var_ref.rb
1540
+ - spec/unit/alf-viewpoint/test_members.rb
1539
1541
  - spec/unit/alf-viewpoint/test_namespace.rb
1540
1542
  - spec/unit/alf-viewpoint/test_native.rb
1541
1543
  - spec/unit/alf-viewpoint/test_native_const.rb