Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swissmanu/hsrhelpers
Some Ruby scripts which might be helpful for HSR students :-)
https://github.com/swissmanu/hsrhelpers
Last synced: 10 days ago
JSON representation
Some Ruby scripts which might be helpful for HSR students :-)
- Host: GitHub
- URL: https://github.com/swissmanu/hsrhelpers
- Owner: swissmanu
- Created: 2012-01-26T12:35:12.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-09-17T06:41:26.000Z (over 12 years ago)
- Last Synced: 2024-12-09T09:18:05.121Z (18 days ago)
- Language: Ruby
- Homepage:
- Size: 126 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HSRHelpers
Some Ruby scripts which might be helpful for HSR students :-)## Installation
At the moment, you have to build the gemspec by yourself:gem build hsrhelpers.gemspec
This will build most commonly a file like `hsrhelpers-X.Y.Z.gem`. Install this file with:gem install hsrhelpers-X.Y.Z.gem
Afterwards, you can call the HSRHelpers by invoking `hsrhelpers` on your commandline.## Sync
Create a job file:```ruby
# HSRScripts Job
# Mirrors script folders from the HSR share to the local machine and copies
# the files afterwards into the local dropbox folder.
HsrHelpers::Sync::Job.new(:hsrscripts) do
# Tweaking the paths. Not related to the sync-tool, but for convenience:
local_hsr_root = '/Users/manuel/HSR'
current_semester = 'Sem 6 - 2012'
local_path = "#{local_hsr_root}/#{current_semester}/"
dropbox_path = "/Users/manuel/Dropbox/HSR/#{current_semester}"
# Mount the script share.
# Note: You can use :hsrscripts afterwards in the one_way statement to
# reference to this share.
mount :hsrscripts do |mount|
type :smb
path 'smb://__USERNAME__:[email protected]/skripte'
end
# One-way-mirroring of specified folders
one_way :server_to_local do |one_way|
one_way.source_base ':hsrscripts/Informatik/Fachbereich'
one_way.target_base local_path
one_way.mirror 'Betriebssystemkonzepte/BsKon', 'BsKon/Skripteserver'
one_way.mirror 'Datenbanksysteme_2/Dbs2', 'Datenbanksysteme_2/Dbs2'
one_way.mirror 'Software-Engineering_3/SE3', 'SE3/Skripteserver'
one_way.mirror 'Verteilte_SW-Systeme/Vss', 'Vss/Skripteserver'
exclude 'Thumbs.db'
end
# Mirror to dropbox folder:
one_way :dropbox do |one_way|
one_way.mirror local_path, dropbox_path
end
# Unmount share:
unmount :hsrscripts
end
```Afterwards, invoke the `hsrhelpers sync` command and pass your job file:
hsrhelpers sync myjobfile # if in same directory
hsrhelpers sync /path/to/myjobfile.rb # if calling from somewhere else