1 ===============================================
2 === Getting Selectricity ======================
3 ===============================================
5 Selectricity is free software and is distributed under the GNU Affero
6 General Public License version 3. You are free to use, modify, and
7 distribute, or rework Selectricity under the terms of that license. Of
8 course, we'd sure like it if you would send fixes back to us and tell us
9 about cool stuff you do with our software!
11 The best way to get Selectricity is just to download it from our source
12 source repository. You'll need the Git version control system or
13 source control manager to check it. You can get it here:
17 Once you have it, getting the source code is pretty easy. You just need
18 to check out a branch with a command like this:
20 git clone http://projects.mako.cc/source/selectricity/.git
22 This will give you the latest *development* version of our code. If you
23 want the latest production version (i.e., what we're running on the
24 site), you can grab that here:
26 git clone http://projects.mako.cc/source/selectricity-live/.git
28 ===============================================
29 === Dependencies ==============================
30 ===============================================
32 To use Selectricity, you'll need to install the following gems in
33 addition to Ruby on Rails, MySQL, and its dependencies:
36 * gruff (http://nubyonrails.com/pages/gruff)
37 * sparklines (http://nubyonrails.com/pages/sparklines)
39 To use Selectricity in development mode, you'll need to install the
44 Also, you will need install the other applications installed first:
46 * imagemagick (http://www.imagemagick.org/)
48 On Ubuntu, you can install install the dependencies with:
49 apt-get install imagemagick libmagick9-dev ruby1.8-dev libwmf-bin
51 Our server configuration uses Mongrel (installed from gems) behind an
52 Apache2 load balancing proxy using mod_proxy.
55 ===============================================
56 === Contributors to Selectricity Include ======
57 ===============================================
59 * Benjamin Mako Hill <mako@atdot.cc>
60 * John Dong <jdong@ubuntu.com>
61 * Justin Sharps <jlsharps@mit.edu>
63 ===============================================
64 === Log =======================================
65 ===============================================
68 jlsharps: I've added a user authentication system known as
69 "acts_as_authenticated" to the code. The plugin is the the vendor/plugins
70 directory. The two most noticeable changes are the AccountController and a
71 redone User model. I've left the UserController in place for now, but the
72 AccountController works in a different manner, so am switching over to that
73 gradually. I saved the 5 lines or so in the old User model, overwrote
74 it with the authenticated generator and then recopied the old stuff back in:
75 has_many :elections and the name() method. The generator also creates its own
76 migration file, but since we are using a create.sql file I adopted the
77 migration file into a new users table in the create.sql file. I have yet to
78 delete the old table because I haven't fully combed through the code yet and
79 determined how many of the old attributes (such as first_name, last_name) may
81 http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated is the
82 best site for documentation regarding acts_as_authenticaed. Also, currently
83 it only stores the user_id in the session, but i just found a guide to help
84 me make it store the entire user object, so I'll do that while my battery
88 Handy trick: use the command 'gem_server' from a shell to create a server at
89 http://localhost:8008 that is an easy to navigate locally-hosted website with
90 all the documentation on local gems you have in a easy to read format.
92 jlsharps: I added the Gruff plug-in today, which is viewable under the folder
93 vender/plugins/gruff. I installed it directly using the Gruff plug-in and
94 included controller generate utility. The version 0.1.2, which doesn't seem to
95 be the latest version. I've looked into it and it see and it seems that the
96 latest version is 0.2.8. However, I wasn't sure how including a gem w/o a plugin
97 would function in end-game rails so I just what I used for now. If you guys
98 (mako of john) know how to do it, it'd probably be better to upgrade, but it
99 didn't seem like the best use of my time right now. I got the plug-in here:
100 http://topfunky.net/svn/plugins/gruff. You can get the gruff gem v 0.2.8 by
101 typing "sudo gem install gruff", I believe it's also hosted on RubyForge.
103 I created the GraphsController for Gruff methods to use. In Pollarize I put them
104 in the ApplicationContorller file, so they would be accessible to all. While
105 that it also an option here, it would also mean there wouldn't be much room for
106 playing around because everything in the Application file has to be perfect or
107 it seems to throw Error Code 500 (basically everything breaks). The show()
108 is a sample sample provided with Gruff.
110 Documentation is here:http://gruff.rubyforge.org/ Alternately, if you have the
111 gem installed, you can use the ri command, or the above mentioned gem_server.
113 If you guys want more helpful stuff here, let me know.
115 ======================================
117 ======================================
119 The XML-RPC API is still under development, but is somewhat functional already:
121 To instantiate a client in Ruby, try something like:
122 client=ActionWebService::Client::XmlRpc.new(SelectricityAPI,"http://localhost:3000/selectricity_service/vote")
125 Getting the results of a quickvote is quite simple:
126 ?> client.get_quickvote_results("test")
127 => #<VoteResultStruct:0x336f92c @approval_winners=[1, 2], @borda_winners=[1], @plurality_winners=[1], @ssd_winners=[1], @errors=[], @condorcet_winners=[1]>
130 client.cast_quickvote("test",1,[[1,2]])
132 To figure out what you're voting for:
133 >> client.get_quickvote_candidate_map("test")=> #<CandidateMap:0x335bbc0 @errors=[], @candidate_names=["test", "test2"], @candidate_ids=[1, 2]>