Skip to content

Commit

Permalink
calcite web now works as a compass extension via a ruby gem
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcpederson committed Apr 1, 2015
1 parent b95a1c0 commit c141ad6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 24 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ gem "calcite-web", :git => "https://github.com/Esri/calcite-web.git", :tag => "c

Be sure to use the replace `current.tag.version` with [the most up to date tag](https://github.com/Esri/calcite-web/releases).

Then in your project's sass file, just import it:
This makes Calcite Web available as a Compass extension. To use Calcite Web, make sure you require the gem in your compass config file (usually found at `config/compass.rb`). an example config file might look like this:

```ruby
require 'calcite-web'

css_dir = "stylesheets"
sass_dir = "sass"
```

Then in your project's sass files, just import it:

```
@import "calcite-web";
```

That will give you everything including sass utilities. You will also need to copy over the JavaScript and image assets to your static folder (see above).
That will give you everything including sass utilities. You will also need to copy over the JavaScript and image assets to your static folder (see above). If you're installing Calcite Web as a gem, it will automatically inc


## NPM

Expand Down
2 changes: 1 addition & 1 deletion calcite-web.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Gem::Specification.new do |s|
s.files = ["lib/calcite-web.rb"]
s.homepage = package["homepage"]

s.add_dependency "sass", "~> 3.4.1"
s.add_dependency "compass", "~> 1.0.3"
end
21 changes: 15 additions & 6 deletions docs/source/get-started/_ruby-gem.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
## Ruby Gem

To install Calcite Web as a ruby gem, add a reference of the gem to your Gemfile:
To install Calcite-Web as a ruby gem, reference the gem from your `Gemfile`:

```ruby
gem "calcite-web", :git => "https://github.com/Esri/calcite-web.git", :tag => "v0.0.10"
```
gem "calcite-web", :git => "https://github.com/Esri/calcite-web.git", :tag => "current.tag.version"
```

Be sure to use the replace `current.tag.version` with [the most up to date tag](https://github.com/Esri/calcite-web/releases).

This makes Calcite Web available as a Compass extension. To use Calcite Web, make sure you require the gem in your compass config file (usually found at `config/compass.rb`). an example config file might look like this:

Be sure to use the most [up-to-date tag](https://github.com/Esri/calcite-web/releases).
```ruby
require 'calcite-web'

css_dir = "stylesheets"
sass_dir = "sass"
```

Then in your project's Sass file, just import it:
Then in your project's sass files, just import it:

```scss
```
@import "calcite-web";
```

Expand Down
18 changes: 3 additions & 15 deletions lib/calcite-web.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# find the 'lib' directory and also the stylesheets directory
base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
stylesheets_path = File.join(base_directory, 'sass')

# if using compass, register as a compass extension
if (defined? Compass)
Compass::Frameworks.register('calcite-web', :stylesheets_directory => stylesheets_path)
else
# if not, register on the Sass path via the environment.
if ENV.has_key?("SASS_PATH")
ENV["SASS_PATH"] = ENV["SASS_PATH"] + File::PATH_SEPARATOR + stylesheets_path
else
ENV["SASS_PATH"] = stylesheets_path
end
end
require 'compass'
dir = File.join(File.dirname(__FILE__), '..', 'lib', 'sass')
Compass::Frameworks.register('calcite-web', :stylesheets_directory => dir)

0 comments on commit c141ad6

Please sign in to comment.