scad_bundler 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 1304333190d408399a3a705c5e1185c7876b8d94804487a4187604545adb960b
4
- data.tar.gz: 64dcf78eb0c410f83574ebfb6d29fc91028ac20e7f47e931a2ddc7b81873676a
3
+ metadata.gz: 04a3382b2f439c015a8015c5f51fed757848f080d5d317f81e40512ad1cc9dfd
4
+ data.tar.gz: dbfd85c34bae0eac6ed9c11f8754bc4481291699302268601d9f875a7be1f731
5
5
  SHA512:
6
- metadata.gz: ed938e5c2e190795c0be88e8e95a017f20833bc594958e74c54b99f2f2aabe247d1301c752aa1d5d978fba56fc2678dffcf529831cabd001678c847b9a65be95
7
- data.tar.gz: b055b7aa77639fe1cc719a389374f07f595a07f8fc9fc34edc05e7ae194cc839f7b21b9c17e15b9113a53df03068443dce10240024cf71f1aefd041b12b71a5b
6
+ metadata.gz: 838dd16189d69c9bb236f9693de03dee26d8cd16ec85e0291707c5e5f535e007325ebe68bb59632ec537bd75bcf4c214314fb194047a3fddf0033c260a429610
7
+ data.tar.gz: 28bba325e33f760dd6f48680b85a5298875fab09eb7741a2b2c1d6c8a14586b02effe10d98668946a4fc354a5f83c3c57cb33278f19405f23e9d946f8257937f
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.gem
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /_yardoc/
data/README.md CHANGED
@@ -19,6 +19,9 @@ Once RubyGems is installed, install `scad_bundler`:
19
19
 
20
20
  ## Usage
21
21
 
22
+ See [this repo](https://github.com/lostapathy/scad_bundler_example) for an example project using scad_bundler.
23
+
24
+
22
25
  Similar to how bundler works, scad_bundler dependencies are defined in a Scadfile and resolved versions are locked in a Scadfile.lock. To initialize your project and create and empty `Scadfile`
23
26
 
24
27
  $ scad_bundle init
@@ -41,7 +44,17 @@ To upgrade libraries, simple call:
41
44
 
42
45
  ## Conventions and Best Practices for creating OpenSCAD Libraries
43
46
 
44
- FIXME: explain how to create a library and what conventions is should follow.
47
+ scad_bundler packages are packaged using a subset of features from [RubyGems](https://rubygems.org). Any documentation related to RubyGems can be used to create these libraries. Since we only use a subset of the functionality, it's probably easiest to copy the .gemspec file from an existing library like [openscad_soften](https://github.com/lostapathy/openscad_libs/openscad_soften) and modify from there. TODO: create a simple command like `scad_bundle new` to create a skeleton file.
48
+
49
+ Your package do not have to be published to rubygems.org in order to use them with scad_bundler. scad_bundler can also use packages from GitHub, local filesystem locations, or anywhere else [supported by bundler](http://bundler.io/gemfile.html).
50
+
51
+ ### (Draft) Conventions
52
+
53
+ * All packages pushed to RubyGems should have the name prefaced by openscad_, i.e., `openscad_soften`
54
+ * All .scad files in your package should be placed in a subdirectory, but it need not match the library name. To use them, you'll use/include them such as `use <soften/cube.scad`
55
+ * Libraries should be built such that users will import them via `use` rather than `include` whenever possible.
56
+ * Only place "public" modules/functions/variables that go together in each .scad file that is meant to be included by the user. Separate "private" modules/functions/variables in separate .scad files to be included from the "public" file. This minimizes the possibilities of namespace collisions with user code.
57
+ * Limit the amount of modules/functions/variables in each "public" scad file to a minimum. This allows the user to import only those modules/functions/variables that they need into their namespace.
45
58
 
46
59
  ## Motivation
47
60
 
@@ -51,6 +64,8 @@ Having a package manager is an essential feature of modern languages, and OpenSC
51
64
 
52
65
  That package manager needs to support versioning and version constraints, so that packages can evolve over time and ship breaking changes rather than stagnate on the first API to coalesce.
53
66
 
67
+ Many OpenSCAD project sit dormant for a long time, then get revisited to fix or upgrade a part. Because of this, it's important that scad_bundler tracks library versions per-project, and different projects on your system can use different library versions. This removes the need to incorporate every library change into your project. This means we're free to improve and evolve our libraries over time, without worry about breaking existing code - that existing code can continue to use the same version of the library until we're ready to upgrade it.
68
+
54
69
  It is my hope that building this knowledge base will also help the community hash out common problems "in userspace" either completely or substantially, so that the scope of changes proposed for OpenSCAD itself can be smaller, more focused, and better tested than many proposals that come up now.
55
70
 
56
71
 
@@ -62,7 +77,7 @@ RubyGems and bundler are a very stable base to build upon, and include very adva
62
77
 
63
78
  #### Why host openscad packages on rubygems.org?
64
79
 
65
- Hosting a package repository is *hard* work and very security sensitive. Using another open source project's repository get us going from day one, and frees us from all of the infrastructure and security headaches hosting our own would entail. If you don't want to post your package as a gem on rubygems.org, it's perfectly fine to post it on github and direct people to use that. Long term, it would be ideal to host a separate package repository but there's nothing wrong with starting out like this.
80
+ Hosting a package repository is *hard* work and very security intensive. Using another open source project's repository get us going from day one, and frees us from all of the infrastructure and security headaches hosting our own would entail. If you don't want to post your package as a gem on rubygems.org, it's perfectly fine to post it on github and direct people to use that. Long term, it would be ideal to host a separate package repository but there's nothing wrong with starting out like this.
66
81
 
67
82
  #### Why pass library information via an environment variable?
68
83
 
@@ -81,7 +96,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/lostap
81
96
  * Long term, create an alternate package repository from RubyGems.org that only lists OpenSCAD packages and adds functionality more applicable to 3d modeling.
82
97
  * Figure out a cleaner way to integrate this with OpenSCAD than just setting an environment variable on OpenSCAD startup.
83
98
  * Better define what features we could add to OpenSCAD to better support libraries (i.e., namespacing support).
84
- * Provide a hook in the library spec to specify a minimum OpenSCAD version to use the library.
99
+ * Provide a hook in the library spec to specify a minimum OpenSCAD version compatible with the library.
85
100
 
86
101
  ## License
87
102
 
data/bin/scad_bundle CHANGED
@@ -28,7 +28,7 @@ when 'init'
28
28
  exit(1)
29
29
  end
30
30
 
31
- File.open('Scadfile', 'w') { |file| file.write("source \"https://rubygems.org\"\n\n# gem 'openscad_util', git: 'https://github.com/lostapathy/openscad-libs'\n") }
31
+ File.open('Scadfile', 'w') { |file| file.write("source \"https://rubygems.org\"\n\n# gem 'openscad_soften'\n") }
32
32
  when 'exec'
33
33
  # Run the specified command with OPENSCADPATH set in the environment
34
34
  specs = Bundler.load.specs.reject {|s| s.name == "bundler" }.sort_by(&:name)
@@ -39,10 +39,10 @@ when 'exec'
39
39
  exec( env, args.join(' ') )
40
40
  when 'update'
41
41
  # Update packages
42
- exec( { 'BUNDLE_GEMFILE' => 'Scadfile' }, %w[bundle update])
42
+ exec( { 'BUNDLE_GEMFILE' => 'Scadfile' }, 'bundle', 'update')
43
43
  when 'install'
44
44
  # Install packages
45
- exec( { 'BUNDLE_GEMFILE' => 'Scadfile' }, %w[bundle install])
45
+ exec( { 'BUNDLE_GEMFILE' => 'Scadfile' }, 'bundle', 'install')
46
46
  else
47
47
  puts "Invalid command: #{command}"
48
48
  exit(1)
@@ -1,3 +1,3 @@
1
1
  module ScadBundler
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scad_bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Francis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-06 00:00:00.000000000 Z
11
+ date: 2018-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler