cassowary 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.autotest ADDED
@@ -0,0 +1,9 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ at.add_mapping(/ext\/.*\/(.*)\.[ch]/) do |_, m|
3
+ ["test/test_#{m[1]}_extn.rb"]
4
+ end
5
+ end
6
+
7
+ Autotest.add_hook :run_command do |at|
8
+ system "rake compile"
9
+ end
data/.gemtest ADDED
File without changes
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ === 1.0.0 2011-06-29
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
data/Manifest.txt ADDED
@@ -0,0 +1,16 @@
1
+ .autotest
2
+ History.txt
3
+ Manifest.txt
4
+ PostInstall.txt
5
+ README.rdoc
6
+ Rakefile
7
+ ext/cassowary/cassowary.so
8
+ ext/cassowary/extconf.rb
9
+ lib/cassowary.rb
10
+ script/console
11
+ script/destroy
12
+ script/generate
13
+ tasks/extconf.rake
14
+ tasks/extconf/cassowary.rake
15
+ test/test_cassowary.rb
16
+ test/test_helper.rb
data/PostInstall.txt ADDED
@@ -0,0 +1,7 @@
1
+
2
+ For more information on cassowary, see http://cassowary.rubyforge.org
3
+
4
+ NOTE: Change this information in PostInstall.txt
5
+ You can also delete it if you don't want it.
6
+
7
+
data/README.rdoc ADDED
@@ -0,0 +1,85 @@
1
+ = cassowary
2
+
3
+ * http://github.com/sfeu/cassowary
4
+
5
+ == DESCRIPTION:
6
+
7
+ Cassowary is an incremental constraint solving toolkit that efficiently
8
+ solves systems of linear equalities and inequalities. Constraints may be
9
+ either requirements or preferences. Client code specifies the constraints
10
+ to be maintained, and the solver updates the constrained variables to have
11
+ values that satisfy the constraints. Version 0.50 of the solving toolkit
12
+ adds support for a one-way finite domain subsolver.
13
+
14
+ This project is concerned with offering a ruby interface for the
15
+ original implementation of cassowary in C.
16
+
17
+ == FEATURES/PROBLEMS:
18
+
19
+ Please consider the current version as software that is still not finished.
20
+
21
+ Currently we can only say that "it works for us"...
22
+
23
+ We are using this constraint solver to generate graphical user interfaces
24
+ with the Multimodal INTeraction framework (MINT).
25
+
26
+ See http://www.multi-access.de
27
+
28
+ == SYNOPSIS:
29
+
30
+ require "rubygems"
31
+ require "cassowary"
32
+ solver = Cassowary::ClSimplexSolver.new
33
+
34
+ size = Cassowary::ClPoint.new()
35
+
36
+ solver.AddConstraint(ClLinearEquation.new(size.X,ClLinearExpression.new(10),Cassowary.ClsStrong))
37
+ solver.AddConstraint(ClLinearInequality.new(size.Y,CnGEQ,ClLinearExpression.new(0),Cassowary.ClsStrong))
38
+
39
+ == REQUIREMENTS:
40
+
41
+ Requires libcassowary debian package available for
42
+
43
+ Ubuntu Lucid 10.0.4_02 LTS 64 Bit
44
+ http://packages.multi-access.de/lucid/libcassowary0_0.70-1_amd64.deb
45
+
46
+ or
47
+
48
+ Ubuntu Lucid 10.0.4_02 LTS 64 Bit
49
+ http://packages.multi-access.de/lucid/libcassowary0_0.70-1_i386.deb
50
+
51
+ or build yourself. Sourcecode is available from original site
52
+
53
+ http://www.cs.washington.edu/research/constraints/cassowary/
54
+
55
+ Copyright Cassowary Constraint Solver: Greg J. Badros, Alan Borning
56
+
57
+ == INSTALL:
58
+
59
+ sudo gem install cassowary
60
+
61
+ == LICENSE:
62
+
63
+ Licensed under the Lesser/Library GPL v2.1 or any version above.
64
+
65
+ Copyright (c) 2011 Sebastian Feuerstack
66
+
67
+ Permission is hereby granted, free of charge, to any person obtaining
68
+ a copy of this software and associated documentation files (the
69
+ 'Software'), to deal in the Software without restriction, including
70
+ without limitation the rights to use, copy, modify, merge, publish,
71
+ distribute, sublicense, and/or sell copies of the Software, and to
72
+ permit persons to whom the Software is furnished to do so, subject to
73
+ the following conditions:
74
+
75
+ The above copyright notice and this permission notice shall be
76
+ included in all copies or substantial portions of the Software.
77
+
78
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
79
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
80
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
81
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
82
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
83
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
84
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
85
+
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ gem 'hoe', '>= 2.1.0'
3
+ require 'hoe'
4
+ require 'fileutils'
5
+ require './lib/cassowary'
6
+
7
+ Hoe.plugin :newgem
8
+ # Hoe.plugin :website
9
+ # Hoe.plugin :cucumberfeatures
10
+
11
+ # Generate all the Rake tasks
12
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
13
+ $hoe = Hoe.spec 'cassowary' do
14
+ self.developer 'Sebastian Feuerstack', 'Sebastian@Feuerstack.org'
15
+ #self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
16
+ self.rubyforge_name = self.name # TODO this is default value
17
+ # self.extra_deps = [['activesupport','>= 2.0.2']]
18
+
19
+ end
20
+
21
+ require 'newgem/tasks'
22
+ Dir['tasks/**/*.rake'].each { |t| load t }
23
+
24
+ # TODO - want other tests/tasks run by default? Add them to the list
25
+ # remove_task :default
26
+ # task :default => [:spec, :features]
Binary file
@@ -0,0 +1,15 @@
1
+ require 'mkmf'
2
+
3
+ CONFIG["CC"] = "g++"
4
+ $CFLAGS = "#{ENV['CFLAGS']} -Wall -O3 "
5
+ if CONFIG["MAJOR"].to_i >= 1 && CONFIG["MINOR"].to_i >= 8
6
+ $CFLAGS << " -DHAVE_DEFINE_ALLOC_FUNCTION"
7
+ end
8
+
9
+ $INCFLAGS << " -I/usr/include/cassowary "
10
+
11
+ $LIBS << " -lcassowary"
12
+
13
+ dir_config("cassowary")
14
+ create_makefile("cassowary")
15
+
data/lib/cassowary.rb ADDED
@@ -0,0 +1,8 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require "cassowary.so"
5
+ module Cassowary
6
+ VERSION = '1.0.0'
7
+ end
8
+
data/script/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # File: script/console
3
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
+
5
+ libs = " -r irb/completion"
6
+ # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
+ libs << " -r #{File.dirname(__FILE__) + '/../lib/cassowary.rb'}"
9
+ puts "Loading cassowary gem"
10
+ exec "#{irb} #{libs} --simple-prompt"
data/script/destroy ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)
@@ -0,0 +1,13 @@
1
+ namespace :extconf do
2
+ desc "Compiles the Ruby extension"
3
+ task :compile
4
+ end
5
+
6
+ task :compile => "extconf:compile"
7
+
8
+ task :test => :compile
9
+
10
+ BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}"
11
+ $hoe.clean_globs |= ["ext/**/#{BIN}", "lib/**/#{BIN}", 'ext/**/Makefile']
12
+ $hoe.spec.require_paths = Dir['{lib,ext/*}']
13
+ $hoe.spec.extensions = FileList["ext/**/extconf.rb"].to_a
@@ -0,0 +1,43 @@
1
+ namespace :extconf do
2
+ extension = File.basename(__FILE__, '.rake')
3
+
4
+ ext = "ext/#{extension}"
5
+ ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
6
+ ext_files = FileList[
7
+ "#{ext}/*.c",
8
+ "#{ext}/*.h",
9
+ "#{ext}/*.rl",
10
+ "#{ext}/extconf.rb",
11
+ "#{ext}/Makefile",
12
+ # "lib"
13
+ ]
14
+
15
+
16
+ task :compile => extension do
17
+ if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
18
+ STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
19
+ STDERR.puts "Gem actually failed to build. Your system is"
20
+ STDERR.puts "NOT configured properly to build #{GEM_NAME}."
21
+ STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
22
+ exit(1)
23
+ end
24
+ end
25
+
26
+ desc "Builds just the #{extension} extension"
27
+ task extension.to_sym => ["#{ext}/Makefile", ext_so ]
28
+
29
+ file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
30
+ Dir.chdir(ext) do ruby "extconf.rb" end
31
+ end
32
+
33
+ file ext_so => ext_files do
34
+ Dir.chdir(ext) do
35
+ sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
36
+ if !ok
37
+ require "fileutils"
38
+ FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestCassowary < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ require 'stringio'
2
+ require 'test/unit'
3
+ require File.dirname(__FILE__) + '/../lib/cassowary'
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cassowary
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Sebastian Feuerstack
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-06-30 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: hoe
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 17
29
+ segments:
30
+ - 2
31
+ - 9
32
+ version: "2.9"
33
+ type: :development
34
+ version_requirements: *id001
35
+ description: |-
36
+ Cassowary is an incremental constraint solving toolkit that efficiently
37
+ solves systems of linear equalities and inequalities. Constraints may be
38
+ either requirements or preferences. Client code specifies the constraints
39
+ to be maintained, and the solver updates the constrained variables to have
40
+ values that satisfy the constraints. Version 0.50 of the solving toolkit
41
+ adds support for a one-way finite domain subsolver.
42
+
43
+ This project is concerned with offering a ruby interface for the
44
+ original implementation of cassowary in C.
45
+ email:
46
+ - Sebastian@Feuerstack.org
47
+ executables: []
48
+
49
+ extensions:
50
+ - ext/cassowary/extconf.rb
51
+ extra_rdoc_files:
52
+ - History.txt
53
+ - Manifest.txt
54
+ - PostInstall.txt
55
+ files:
56
+ - .autotest
57
+ - History.txt
58
+ - Manifest.txt
59
+ - PostInstall.txt
60
+ - README.rdoc
61
+ - Rakefile
62
+ - ext/cassowary/cassowary.so
63
+ - ext/cassowary/extconf.rb
64
+ - lib/cassowary.rb
65
+ - script/console
66
+ - script/destroy
67
+ - script/generate
68
+ - tasks/extconf.rake
69
+ - tasks/extconf/cassowary.rake
70
+ - test/test_cassowary.rb
71
+ - test/test_helper.rb
72
+ - .gemtest
73
+ homepage: http://github.com/sfeu/cassowary
74
+ licenses: []
75
+
76
+ post_install_message:
77
+ rdoc_options:
78
+ - --main
79
+ - README.rdoc
80
+ require_paths:
81
+ - lib
82
+ - ext/cassowary
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ requirements: []
102
+
103
+ rubyforge_project: cassowary
104
+ rubygems_version: 1.8.5
105
+ signing_key:
106
+ specification_version: 3
107
+ summary: Cassowary is an incremental constraint solving toolkit that efficiently solves systems of linear equalities and inequalities
108
+ test_files:
109
+ - test/test_cassowary.rb
110
+ - test/test_helper.rb