github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

zippy / flowplace

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 13
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (1)
  • Wiki (1)
  • Graphs
  • Branch: membrane

click here to add a description

click here to add a homepage

  • Branches (2)
    • master
    • membrane ✓
  • Tags (1)
    • v0.0.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A rails based social platform for using free currencies and building wisdom driven organizations. — Read more

  cancel

http://flowplace.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

removed old cirlces stuff 
zippy (author)
Fri Jan 29 07:37:31 -0800 2010
commit  78cd2781d6eff559c9debe2a0dd726296c15c032
tree    27c630eee1e52c895e1ffa3fb4a6de1d75fd4865
parent  c4f6af97421b21bbd2fbd6161c8c9e9205a5f7ef
flowplace / currencies / membrane.xgfl currencies/membrane.xgfl
100644 127 lines (125 sloc) 4.787 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<game>
  <description>
    Membrane currencies are used to establish circles by forming a context that names currencies and users, and then assigning users to roles (player_classes) in the circle's currencies.<br />
    Player classes: self (represents the circle as a whole), member (users names in the circle), namer (the stewards responsible for adding users and currencies to the circle)<br />
    Self Summary functions: Currencies--The list of currencies used by the circle<br />
    Self Plays:
      -- none yet --
    Member Summary function: Permissions--The list of permissions a member has.<br />
    Member Plays:
      -- none yet --
    Namer Summary Function: none
    Namer Plays:
      bind_currency(from,to,currency,name,meta) # adds a currency to the circle to be known as name.
      unbind_currency(from,to,currency,name) # adds a currency to the circle to be known as name.
      name_member(from,user,name) # names a new member player into the circle as for a user.
      grant(from,to,currency,player_class) # adds a member of the circle to a currency as a given player_class.
      revoke(from,to,currency,player_class)
  </description>
  <player_classes>
    <player_class name="member" />
    <player_class name="namer" />
    <player_class name="self" />
  </player_classes>
  <states>
    <state player_class="member"><hash name="permissions" /></state>
    <state player_class="self"><hash name="currencies" /></state>
  </states>
 
  <plays>
    <play name="_new_self">
      <fields>
        <field type="" id="class" />
      </fields>
      <script type="ruby">
        <![CDATA[ @self_state.currencies = {};]]>
      </script>
    </play>
    <play name="_new_member">
      <fields>
        <field type="" id="class" />
      </fields>
      <script type="ruby">
        <![CDATA[ @member_state.permissions = {};]]>
      </script>
    </play>
    <play name="bind_currency" player_classes="namer">
      <fields>
         <field type="player_namer" id="from" />
         <field type="player_self" id="to" />
         <field type="currency" id="currency" />
         <field type="string" id="name" />
      </fields>
      <script type="ruby">
        <![CDATA[
         currencies = @play.to['currencies']
         return "Currency must be specified" unless @play.currency.is_a?(Currency)
         name = @play.name
         name ||= @play.currency.name
         currencies[@play.currency.id] = name
         true
         ]]>
      </script>
      <play_sentence lang='en'> <from /> binds <currency /> to <to /> as <name /></play_sentence>
    </play>
    <play name="name_member" player_classes="namer">
      <fields>
         <field type="player_namer" id="from" />
         <field type="user" id="user" />
         <field type="string" id="name" />
      </fields>
      <script type="ruby">
        <![CDATA[
          ca = self.api_new_player('member',@play.user,@play.name)
          if ca.valid?
            true
          else
            ca.errors.full_messages.join('; ')
          end
         ]]>
      </script>
      <play_sentence lang='en'><from /> dubs <user /> as <name /></play_sentence>
    </play>
    <play name="grant" player_classes="namer">
      <fields>
         <field type="player_namer" id="from" />
         <field type="player_member" id="to" />
         <field type="currency" id="currency" />
         <field type="string" id="player_class" />
      </fields>
      <script type="ruby">
        <![CDATA[
          currency = @play.currency
            
           to = @play.to['_currency_account']
           ca = currency.api_new_player(@play.player_class,to.user,to.name)
           if ca.valid?
             perms = @play.to['permissions']
             perms[currency.name] ||= {}
             perms[currency.name][@play.player_class] = true
             true
           else
             ca.errors.full_messages.join('; ')
           end
         ]]>
      </script>
      <play_sentence lang='en'><from /> grants <to /> access to <currency /> as <player_class /></play_sentence>
    </play>
    <play name="revoke" player_classes="namer">
      <fields>
         <field type="player_namer" id="from" />
         <field type="player_member" id="to" />
         <field type="currency" id="currency" />
         <field type="string" id="player_class" />
      </fields>
      <script type="ruby">
        <![CDATA[
        perms = @play.to['permissions']
        perms[@play.currency] ||= {}
        perms[@play.currency].delete(@play.player_class)
        perms.delete(@play.currency) if perms[@play.currency].size == 0
        true
        ]]>
      </script>
      <play_sentence lang='en'><from /> revokes <to />'s <player_class /> access to <currency /></play_sentence>
    </play>
  </plays>
</game>
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server